Skip to content

Instantly share code, notes, and snippets.

@jsdevel
Last active December 26, 2015 04:49
Show Gist options
  • Save jsdevel/7095741 to your computer and use it in GitHub Desktop.
Save jsdevel/7095741 to your computer and use it in GitHub Desktop.
name="global";
var a = {
name:"a",
prop:Func,
b:{
name:"b",
prop:Func
}
};
function Func(){
console.log(this.name);
}
Func.prototype.name="Func";
Func();//prints global
new Func();//prints Func
a.prop();//prints a
a.b.prop();//prints b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment