1. var a = {
arr:[],
method:function method(){
console.log(this.arr)} //this is undefined
}
2. var a = arr:[],
method:function(){
console.log(this.arr)} //this gives a
}
Can somebody explain me why this
context gets lost in the first example?