Created
July 8, 2015 09:01
-
-
Save stiofand/524fd1bb647cb1aabd05 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var x = { | |
name:'Steve', | |
hello:function(){ | |
var that = this; | |
var helper = function(){ | |
console.log('X Name ',that.name); | |
}; | |
helper(); | |
} | |
}; | |
var y = { | |
name:'Steve', | |
hello:function(){ | |
var helper = function(){ | |
console.log('Y Name ' ,this.name); | |
}.bind(this); | |
helper(); | |
} | |
}; | |
var z = { | |
name:'Steve', | |
hello:function(){ | |
var helper =()=>{ | |
console.log('Z Name ',this.name); | |
} | |
helper(); | |
} | |
}; | |
x.hello(); | |
y.hello(); | |
z.hello() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment