Skip to content

Instantly share code, notes, and snippets.

@soharu
Last active January 2, 2016 09:39
Show Gist options
  • Save soharu/8284890 to your computer and use it in GitHub Desktop.
Save soharu/8284890 to your computer and use it in GitHub Desktop.
Example of constructor property
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