标签:this htm UNC inner fun bsp html 实例 class
我第一次接触到箭头函数=>的使用是在rxjs的教程中,当时这个用法看得我糊里糊涂。
箭头函数的两个好处:简化书写、不会绑定this。
看一下箭头函数的使用实例:
let plusOne = (i, j) => i + j;
document.body.innerHTML = plusOne(5, 4);
以上代码等价于:
let plusOne = function(i) { return i + 1; } document.body.innerHTML = plusOne(5);
标签:this htm UNC inner fun bsp html 实例 class
原文地址:https://www.cnblogs.com/potatorain/p/11421171.html