Skip to content

Instantly share code, notes, and snippets.

@stevekinney
Created July 14, 2016 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save stevekinney/c71ccebfb2243a7cf1407a45ab6acdb1 to your computer and use it in GitHub Desktop.
Save stevekinney/c71ccebfb2243a7cf1407a45ab6acdb1 to your computer and use it in GitHub Desktop.
// {} object literal
// "" string literal
// 23 number literal
// [] array literal
function makeBurger(pattyType) {
return {
pattyType: pattyType,
toppings: [],
addTopping: function (topping) {
this.toppings.push(topping);
console.log(this, this.toppings);
}
};
}
console.log(cheeseBurger.toppings);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment