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

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.

主站蜘蛛池模板: 阳山县| 平利县| 奉新县| 涟源市| 龙泉市| 丰县| 宜春市| 邵东县| 伊吾县| 淮阳县| 台安县| 庆阳市| 安西县| 普宁市| 鄂托克前旗| 东丽区| 齐齐哈尔市| 土默特右旗| 抚宁县| 鱼台县| 文登市| 涞源县| 大荔县| 杭州市| 昭苏县| 济源市| 尉犁县| 凤阳县| 湘潭市| 白沙| 宜都市| 海淀区| 泰宁县| 阳新县| 获嘉县| 饶阳县| 镇坪县| 龙里县| 左贡县| 四平市| 尚志市|