Instantly share code, notes, and snippets.

Embed
What would you like to do?
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