箭头函数提供了一种更加简洁的函数书写方式。基本语法是: 
参数 => 函数体
// 传统var f1 = function(a){return a }console.log(f1(1))// ES6var f2 = a => aconsole.log(f2(1))// 当箭头函数没有参数或者有多个参数,要用 () 括起来。// 当箭头函数函数体有多行语句,用 {} 包裹起来,表示代码块,// 当只有一行语句,并且需要返回结果时,可以省略 {} , 结果会自动返回。var f3 = (a,b) => {let result = a+breturn result}console.log(f3(6,2)) // 8// 前面代码相当于:var f4 = (a,b) => a+b
箭头函数多用于匿名函数的定义
