写法:
箭头函数:var show = ()=>{console.log("hello wold")}show() 只能在该函数后面调用相当于:var show = function(){console.log("hello wold")}show() 只能在该函数后面调用
如果箭头函数中只有一段语句可以简写
var show =()=>console.log("hello world!!");show()
带参数的箭头函数
var go =x=>console.log(x); //一段语句可简写var sum =(x,y)=>{console.log(x+y)};go(2);sum(4,3);
