Created
February 26, 2016 12:40
-
-
Save teisman/a2c6f07880db1d2301f6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Recipe = function (title, servings, ingredients) { | |
this.title = title; | |
this.servings = servings; | |
this.ingredients = ingredients; | |
}; | |
Recipe.prototype.print = function() { | |
console.log(this.title); | |
console.log("Serves: " + this.servings); | |
console.log("Ingredients:") | |
for (i = 0; i < this.ingredients.length; i++) { | |
console.log(this.ingredients[i]); | |
} | |
}; | |
var mole = new Recipe("Mole", 2, ["cinnamon", "cumin", "cocoa"]); | |
mole.print(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment