官术网_书友最值得收藏!

  • 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)
];
主站蜘蛛池模板: 扶风县| 时尚| 南漳县| 德保县| 广水市| 平和县| 灯塔市| 瑞昌市| 博客| 连州市| 阜城县| 忻城县| 新巴尔虎左旗| 沂源县| 雷山县| 大宁县| 河池市| 昂仁县| 海阳市| 达孜县| 沙河市| 建宁县| 布尔津县| 葫芦岛市| 高台县| 泾川县| 高陵县| 浮山县| 馆陶县| 阜平县| 库伦旗| 漳浦县| 内黄县| 陆河县| 衡东县| 陆丰市| 淮滨县| 乐业县| 康定县| 昭觉县| 台湾省|