Skip to content

Instantly share code, notes, and snippets.

@trivektor
Created November 11, 2011 18:13
Show Gist options
  • Save trivektor/1358737 to your computer and use it in GitHub Desktop.
Save trivektor/1358737 to your computer and use it in GitHub Desktop.
Javascript prototype notes
Prototype is intimately tied to constructors so calls to prototype only works on a constructor function (for example Fruit)
Prototype is more memory efficient (50 copies of the eat function for 50 fruit instances) but could be harder to read and maintain
Prototype works in a delegation fashion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment