1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| let fun1=(a,b)=>{return a+b;}
let fun2=()=>{console.log('你好');}
let fun3=name=>{console.log(`你好${name}`);}
let fun4=name=>`你好${name}`; console.log(fun4('小明'));
let obj={ fun5(){console.log('fun5:',this);}, fun6:()=>{console.log('fun6:',this);} } obj.fun5(); obj.fun6();
|