Skip to content

Instantly share code, notes, and snippets.

@aredridel
Created September 5, 2016 19:39
Embed
What would you like to do?
<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