Created
February 28, 2017 02:15
-
-
Save egrueter-dev/f3f9f7c060f6003d99b44929252cd571 to your computer and use it in GitHub Desktop.
prototypal-inheritance
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
// Creating the first prototype | |
const proto1 = function() {}; | |
proto1.prop2 = 'protos property'; | |
const obj = Object.create(proto1); | |
obj.prop = 'object\'s property'; | |
console.log(obj.prop); | |
console.log(obj.prop2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment