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

Lambda expressions

Lambda expressions are just expressions that can be used to declare anonymous functions (functions without a name). Before the ES6 specification, the only way to assign a function as a value to a variable was to use a function expression:

const log = function(arg: any) { console.log(arg); };

The ES6 specification introduced the arrow function syntax:

const log = (arg: any) => console.log(arg);

Please refer to Chapter 2, Mastering Functions, Chapter 4, The Runtime – The Event Loop and the this Operator, and Chapter 5, The Runtime – Closures and Prototypes, to learn more about arrow functions and function expressions.

主站蜘蛛池模板: 塔城市| 巢湖市| 东兴市| 博野县| 柳江县| 门源| 苍山县| 兴文县| 北宁市| 柳河县| 浦东新区| 义马市| 甘孜县| 平度市| 托克托县| 长岭县| 嘉黎县| 海淀区| 昂仁县| 洪泽县| 随州市| 临江市| 泗水县| 时尚| 静乐县| 连南| 连江县| 达州市| 钟山县| 家居| 聂荣县| 华宁县| 商河县| 遵化市| 阿克苏市| 金阳县| 五河县| 盘山县| 永平县| 柳州市| 临武县|