1 :x=>x*x
function (x){
return x*x
}
2: x=>{
if(x>0){
return 1;
}else{
return 0;
}
}
function (x){
if(x>0){
return 1;
}else{
return 0;
}
}
3: (x,y)=>x+y
function (x,y){
return x+y;
}
4: x=>({name:'lili'})
function (x){
return {name:'lili'}
}
1 :x=>x*x
function (x){
return x*x
}
2: x=>{
if(x>0){
return 1;
}else{
return 0;
}
}
function (x){
if(x>0){
return 1;
}else{
return 0;
}
}
3: (x,y)=>x+y
function (x,y){
return x+y;
}
4: x=>({name:'lili'})
function (x){
return {name:'lili'}
}
转载于:https://www.cnblogs.com/3wHaozi/p/8596044.html