1: Simplified definition of ordinary functions

let f=v= >v// Variable name = parameter => return value (function body)
// same as the following
var f=function(v){
return v;
}
Copy the code

Back to 123

var f2=function(v){
return 123;
}
/ / is equivalent to
let f2=() = >123;

Copy the code

Multiple parameters


var f3=function(n1,n2){
return n1+n2;
}
/ / is equivalent to
let f2=(n1,n2) = >n1+n2;

Copy the code

Arrow function corresponding to the this point and a series of questions, will be updated in the future