Unit 6: Lesson 7


var friends = {
bill: {
number:"(206) 555-5555",
address: ['One rainbow road']
steve: {
number:"(226) 555-5555",
address: ['Seven rainbow road']
var list = function (friends) {
for (var firstName in friends) {
var search = function(friends) {
for (var key in friends) {
if (friends[key].firstName === name){
console.log (friends[firstName, lastName, number, address]);
return friends[key];
} else {
console.log ("non-existant");

It keeps saying "SyntaxError: Unexpected end of input".. I need help please.. Thanks


Count your curly braces

Helps if you match your indentation to the braces so that you can tell if something's missing.

You can also prettify and run it in Firefox's scratchpad which is opened with Shift+F4


Thanks a lot... but now it shows "Oops, try again. Did you create a function called search?"


Test it and see if it's in working order


I don't understand.. I used the same code, and counted the curly brackets


If it's questioning the existence of something you think you've created, then it's probably not working in some way. So test it and find out in what way it misbehaves


Oh.. ok thanks a lot.. I'll try that


I haven't read your code or the instructions, but make sure you've understood the instructions correctly, it's not all that uncommon to implement something other than what's specified and therefore think that you meet specifications when really you are testing for something else