Last active
September 12, 2018 11:15
-
-
Save manekinekko/b9d86e0b154e31e4f08354af2d91f4a6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function Foo() { | |
this.bar = function() { | |
return this; | |
} | |
} | |
// exemple 1 | |
var foo = new Foo(); | |
console.log(foo); //=> Foo | |
console.log(foo.bar() instanceof Foo); //=> true | |
// exemple 2 | |
var foo1 = Foo(); | |
console.log(typeof foo1); //=> undefined | |
console.log(typeof window.bar); //=> function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment