Last active
January 2, 2016 09:39
-
-
Save soharu/8284890 to your computer and use it in GitHub Desktop.
Example of constructor property
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
var F = function() {}; // This is a function object | |
var p = F.prototype; // This is the prototype object associated with it | |
var c = p.constructor; // This is the function associated with the prototype | |
c === F // => true, F.prototype.constructor === F fo any function | |
var o = new F(); // Create an object o of class F | |
o.constructor === F // => true, the constructor property specifies the class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment