Skip to content

Instantly share code, notes, and snippets.

@tsongas
Created February 17, 2015 18:49
Show Gist options
  • Save tsongas/dbf5fdc1f0c179eafe2c to your computer and use it in GitHub Desktop.
Save tsongas/dbf5fdc1f0c179eafe2c to your computer and use it in GitHub Desktop.
prototype vs __proto__
__proto__ is the actual object that is used in the lookup chain to resolve methods. It is a property that all objects have. This is the property which is used by the JavaScript engine for inheritance. According to ECMA specifications it is supposed to be an internal property, however most vendors allow it to be accessed and modified.
prototype
prototype is a property belonging only to functions. It is used to build __proto__ when the function happens to be used as a constructor with the new keyword
http://stackoverflow.com/questions/9959727/proto-vs-prototype-in-javascript
http://webstuff.leods92.com/post/25392435543/javascript-prototype-vs-proto
http://www.quora.com/What-is-the-difference-between-__proto__-and-prototype
http://dailyjs.com/2012/11/26/js101-proto/
http://geekabyte.blogspot.com/2013/03/difference-between-protoype-and-proto.html
https://javascriptweblog.wordpress.com/2010/06/07/understanding-javascript-prototypes/
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment