📜  js 箭头匿名函数 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:19.698000             🧑  作者: Mango

代码示例1
let show = function () {
    console.log('Anonymous function');
};
//… can be shortened using the following arrow function:
let show = () => console.log('Anonymous function');

//Similarly, the following anonymous function:
let add = function (a, b) {
    return a + b;
};

//is equivalent to the following arrow function:
let add = (a, b)  => a + b;