Skip to content

Instantly share code, notes, and snippets.

@mbuttler
Created June 3, 2015 14:37
Show Gist options
  • Save mbuttler/84d850586c1a718aa9b6 to your computer and use it in GitHub Desktop.
Save mbuttler/84d850586c1a718aa9b6 to your computer and use it in GitHub Desktop.
Matt doesn't really know functions that well yet.
// First we define zee objects...
var friends = {
bill: {
firstName: "Bill",
lastName: "Grates",
number: "613-555-7310",
address: ['123 Any Street', 'Ottawa, ON', 'K2P 1Y8'] },
steve: {
firstName: "Steve",
lastName: "Jerbs",
number: "613-555-7312",
address: ['223 Any Street', 'Ottawa, ON', 'K2P 1Y7'] }
};
//
// Then we create the functions
// Instructions for the first
// http://take.ms/5yVba
//
var list = function (pals) {
for (var key in friends)
console.log(key);
};
//
// And the second
// http://take.ms/8tT2Zq
//
var search = function(name) {
for (var firstName in friends) {
return key.lastName;
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment