Skip to content

Instantly share code, notes, and snippets.

@stiofand
Created July 8, 2015 09:01
Show Gist options
  • Save stiofand/524fd1bb647cb1aabd05 to your computer and use it in GitHub Desktop.
Save stiofand/524fd1bb647cb1aabd05 to your computer and use it in GitHub Desktop.
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