Last active
December 26, 2015 04:49
-
-
Save jsdevel/7095741 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
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