- Redux Quick Start Guide
- James Lee Tao Wei Suresh Kumar Mukhiya
- 70字
- 2021-07-02 12:40:28
Adding functions to objects and arrays
A variable can be added to any object. Since a function is stored in a variable, it can also be added to objects, as follows:
const myCalculator = {
bmi: (weight, height) => weight / (height * height)
};
Similarly, we can add it to an array, as follows:
const myCalculator = [
Bmi => (weight, height) => weight / (height * height)
];
推薦閱讀
- Vue.js設(shè)計與實現(xiàn)
- TypeScript Essentials
- Pandas Cookbook
- 深入淺出WPF
- x86匯編語言:從實模式到保護(hù)模式(第2版)
- Java Web開發(fā)技術(shù)教程
- AutoCAD VBA參數(shù)化繪圖程序開發(fā)與實戰(zhàn)編碼
- C語言程序設(shè)計
- Clojure for Java Developers
- IPython Interactive Computing and Visualization Cookbook
- Clojure High Performance Programming(Second Edition)
- Python Automation Cookbook
- Scratch編程從入門到精通
- 輕松學(xué)Scratch 3.0 少兒編程(全彩)
- Learning PrimeFaces Extensions Development