Arrow Function
let newArr1 = [1,2,3,4,5].map(function(v, i, o){ return v * 2; }) console.log(newArr1); let newArr2 = [1,2,3,4,5].map((v, i, o) => v * 3 ); console.log(newArr2); this context const myObj = { runTimeout(){ setTimeout(function(){ this.printData(); }, 200) }, printData(){ console.log('hihi'); } } myObj.runTimeout(); // error 1. const myObj = { runTimeout(){ setTimeout(function(){ this.printData(); ..
2023.01.26