Skip to content

Instantly share code, notes, and snippets.

@Louiefigz
Created December 12, 2016 17:51
Show Gist options
  • Save Louiefigz/7447617447766da179adcc7e6208b304 to your computer and use it in GitHub Desktop.
Save Louiefigz/7447617447766da179adcc7e6208b304 to your computer and use it in GitHub Desktop.
function Sandwich(bread, ingredients, cut) {
this.bread = bread;
this.ingredients = ingredients;
this.cut = cut;
this.serve = function() {
console.log("here's your " + this.name + ", enjoy!");
}
}
var blt = new Sandwich("white", ["bacon","lettuce","tomato","mayo"],"rectangle");
// setting the name of Blt here will allow us to run the following line.
blt.name = "BLT";
blt.serve(); // here's your BLT, enjoy!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment