Created
January 31, 2014 00:41
-
-
Save nola/8723259 to your computer and use it in GitHub Desktop.
Objects parent > child > grandchild constructor
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
| var parent = { | |
| get: function fn(){ | |
| return this.val; | |
| }, | |
| val:42 | |
| } | |
| var child = Object.create(parent); | |
| child.val = 3.14; | |
| var grandchild = Object.create(child); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment