Created
October 24, 2017 19:45
-
-
Save agatablue/e0a02e53e9b26e1c18c1df5766e3c4b5 to your computer and use it in GitHub Desktop.
This file contains 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 greenAlien = { | |
sayHello: function() { | |
return `Hello, my name is ${ this.name }` | |
} | |
} | |
var redAlien = Object.create(greenAlien); | |
redAlien.fly = function() { | |
console.log('I can fly'); | |
} | |
var alienA = Object.create(greenAlien); | |
alienA.name = "Optimus"; | |
var alienB = Object.create(redAlien); | |
alienB.name = "Clark"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment