7. Search for a friend



I do get this exercise, but, becasue I am a noob, I dont know how to execute it. What is wrong with my code?

var friends = {
    Bill: {
        firstName: "Bill",
        lastName: "Gates",
        number: "(206) 555-5555",
        address: ["Apple", "Apple1", "Apple3"]
    Steve: {
        firstName: "Steve",
        lastName: "Jobs",
        number: "(206) 555-5556",
        address: ['Micro', 'Micro', 'Micro']
var list = function(){
    for (var key in friends){
var search = fucntion(name){
    for(var key in obeject){
        if(friends[key].firstName === name){
            return friends[key];


You forgot the semicolon after console.log(key)

Again you forgot the semicolon. Just make sure that you have semicolons in the proper places, it is a very common mistake to forget them which is one of the reasons why I like Python and Swift so much. I hope this helped you and you don't have any more problems with that exercise :slight_smile:


There's a typo in the word 'function'


I didn't notice that part :slight_smile: good spot.


Thank you!, I was that simple :slight_smile:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.