Created
February 5, 2015 05:45
-
-
Save dgowrie/e01c363f1732c043b85e to your computer and use it in GitHub Desktop.
Prototypal inheritance in JavaScript as described by Douglas Crockford
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
| Prototypal inheritance in JavaScript is described by Douglas Crockford as: you make prototype objects, and then ... make new instances. Objects are mutable in JavaScript, so we can augment the new instances, giving them new fields and methods. These can then act as prototypes for even newer objects. We don't need classes to make lots of similar objects....Objects inherit from objects. What could be more object oriented than that? | |
| http://javascript.crockford.com/prototypal.html |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
DIFFERENT but related:
Advantages to using the "new" keyword for prototypal inheritance AKA "classical model" AKA "constructor pattern" VERSUS the "prototypal pattern" via Object.create: