Skip to content

Instantly share code, notes, and snippets.

@microbial
Created February 16, 2016 08:00
Show Gist options
  • Save microbial/ca4b44808e9300151faf to your computer and use it in GitHub Desktop.
Save microbial/ca4b44808e9300151faf to your computer and use it in GitHub Desktop.
Shopping List
var arr = [];
var obj = {};
var fun = function () {};
var shoppingList = [
'cheese',
'milk',
'bacon'
];
var firstItem = shoppingList[0];
var lastItem = shoppingList[2];
var shopper;
var shopList2 = {
dairy: 'milk',
meat: 'bacon',
key: 'value',
vitamins: ['A', 'E', 'D'],
shop: function (item, price) {
item = item || 'something'
price = price || "FREE"
return 'I am shopping for ' + item + '. At the cost of ' + price
}
}
var shop = shopList2.shop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment