- 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)
];
推薦閱讀
- CockroachDB權威指南
- C++ Builder 6.0下OpenGL編程技術
- Web Scraping with Python
- 算法基礎:打開程序設計之門
- Network Automation Cookbook
- Visual C++數字圖像處理技術詳解
- Drupal 8 Configuration Management
- Learning Data Mining with R
- UML 基礎與 Rose 建模案例(第3版)
- Shopify Application Development
- Mastering Unreal Engine 4.X
- Learning Redux
- C語言從入門到精通(視頻實戰版)
- C語言程序設計實驗指導與習題精解
- Java Web應用開發