Skip to content

Instantly share code, notes, and snippets.

@aredridel
Created September 5, 2016 19:39
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 aredridel/2d011ea7a602816af5e3338e84fb7b6b to your computer and use it in GitHub Desktop.
Save aredridel/2d011ea7a602816af5e3338e84fb7b6b to your computer and use it in GitHub Desktop.
<script src=t1.js></script>
<script src=t2.js></script>
console.log("help me");
function Character(name){
this.name = name;
// this.id = createCharacterId();
console.log("obi-wan kenobi");
};
Character.prototype.printName = function(){ console.log("Hi, I'm " + this.name) }
Character.prototype.printList = function(){ console.log(this.recipeList) }
console.log("you're my");
function CookingCharacter(name, recipeList){
Character.call(this, name);
this.recipeList = recipeList;
}
CookingCharacter.prototype = Object.create(Character.prototype);
console.log("only hope");
var cook = new CookingCharacter("JP", ["apples"]);
cook.printName();
cook.printList();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment