Contact List . 8.Victory (How to solve it correctly, and solve it beautifully )


#1

https://www.codecademy.com/en/courses/javascript-beginner-en-3bmfN/0/8?curriculum_id=506324b3a7dffd00020bf661


Replace this line with your code. 
var friends = {};
friends.bill = {
    firstName: "Bill",
    lastName: "Gates",
    number: "29-3636789",
    age: 27,
    address: ["Minsk","sedih","12a"]
};
friends.steve = {
    firstName: "Steve",
    lastName: "Jobs",
    age: 26,
    number: "29-1111189",
    address: ["Soligorsk","Lenina","1"]
};

var list = function(object) {
    for(var key in object) {
        console.log(key);
    }
};

var search = function(name) {
    for (var prop in friends) {
        if (friends[prop].firstName === name) {
            console.log(friends[prop]);
            return(friends[prop]);
        }
    }
}
list(friends);
search("Bill");
search("Steve");


#2

when you created the topic, you where provided with a template:

<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Look to the right of this box. That is how your post will look to everyone else.>

<Below this line, add a link to the EXACT exercise that you are stuck at.>


<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>


<do not remove the three backticks below>
```

Replace this line with your code. 


```

please fill in the template so we have the details needed to help, we can't help you if don't include any details

`


#3

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