var name = 'the window'; var object1 = { name:'the obj', myFunc: function(){ console.log(this.name) }, otherFunc: function(){ function inner(){ console.log(this.name); } inner(); } } object1.myFunc(); console.log(object1.name); console.log(name); object1.otherFunc();