What does the last parameter (this) do in the forEach function?
e.g.
[1,2,3].forEach(function(x){
console.log(k[x])
},this)
I also realized that I get an undefined after looping the array. Why is that?
e.g.
[1,2,3].forEach(function(x){
console.log(k[x])
},this)
I also realized that I get an undefined after looping the array. Why is that?