Skip to content

Instantly share code, notes, and snippets.

@agatablue
Created October 24, 2017 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agatablue/e0a02e53e9b26e1c18c1df5766e3c4b5 to your computer and use it in GitHub Desktop.
Save agatablue/e0a02e53e9b26e1c18c1df5766e3c4b5 to your computer and use it in GitHub Desktop.
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