Created
September 28, 2015 21:00
-
-
Save qetr1ck-op/02ee2ee811e78b50274c 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 Animal() { }; | |
| var animal = new Animal(); | |
| /* | |
| creates automatically | |
| Animal.prototype = { | |
| constructor: Animal | |
| } | |
| */ | |
| console.log(animal.constructor == Animal) //true | |
| console.log(animal.hasOwnProperty('constructor')) // false | |
| console.log(Animal.hasOwnProperty('constructor')) // true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment