7/8 search names


var friends = {
Bill: {
lastName: "Gates",
address: ['One microsoft way', 'virginia']
Steve: {
lastName: "Jobs",
address:['Caramel Aplle', 'virginia']
var search = function(friends) {
for(var firstName) {
if(firstname == Steve || Bill){
console.log(firstName, lastName,number,address)
else{console.log("something went wrong")};



I have no clue how to solve this.


The code is really confusing, can you tell me what you where trying to do? It looks like you have defined objects inside objects, and inside those objects you defined arrays? I can tell you some syntax errors I found quickly. This are the lines corrected

console.log("something went wrong"); // I added this last semicolon


if(firstname == "Steve" || "Bill"){ //I added the double quoation marks as they are strings. I'm not really sure but maybe you should add parenthesis around ("Steve" || "Bill")

Please let me know what you were trying to do there. Re-post your code with the 2 corrections I made and with comments explaining what you tried to do around different places (mainly the beginning).


I was confusing myself. finily figured it out by looking back at the first
Exercise. Thank you for the effort


I stuck in this code. It throws syntax error. But I couldn't figure it out. Please help me... Do we need to remove the list function here?

var friends = {
bill: {
firstName: "Bill",
lastName: "Murray",
number: "(206) 555-5555",
address: ['Pine Garden Lane', 'Dunwoody', 'GA', '30338']
steve: {
firstName: "Steve",
lastName: "Waugh",
number: "(245)-158-1561",
address: ['Junior Avenue', 'Atlanta', 'GA', '30318']
var list = function(friends) {
for (var firstName in friends) {
var search = function(friends) {
for (var firstName) {
if (firstName === "Bill" || "Steve") {
console.log(firstName, lastName, number, address);
} else {
console.log("No results found.");
search (steve);