箭头函数=>
我第一次接触到箭头函数=>的使用是在rxjs的教程中,当时这个用法看得我糊里糊涂。
箭头函数的两个好处:简化书写、不会绑定this。
看一下箭头函数的使用实例:
let plusOne = (i, j) => i + j;
document.body.innerHTML = plusOne(5, 4);
以上代码等价于:
let plusOne = function(i, j) { return i + j; } document.body.innerHTML = plusOne(5, 4);

浙公网安备 33010602011771号