Created
June 3, 2015 14:37
-
-
Save mbuttler/84d850586c1a718aa9b6 to your computer and use it in GitHub Desktop.
Matt doesn't really know functions that well yet.
This file contains 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
// 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