8.Victory - Bonus, please help


#1


8.Victory Contact List


The search function works for Bill and Steve but not for Adri. I can't find why. Can somebody explain please ?
It will log in the console:
"Found nobody
Found nobody
Found nobody"


var friends = new Object();

friends.bill = new Object();
    friends.bill.firstName = "Bill";
    friends.bill.lastName = "Gates";
    friends.bill.number = "0736548965";
    friends.bill.address = ["Microsoft Way", "10", "USA"];
    
friends.steve = new Object();
    friends.steve.firstName = "Steve";
    friends.steve.lastName = "Jobs";
    friends.steve.number = "0759842621";
    friends.steve.address = ["Apple Tree Way", "6", "USA"];
    
friends.adri = new Object();
    friends.adri.fisrtName = "Adri";
    friends.adri.lastName = "Burz";
    friends.adri.number = "07985621548";
    friends.adri.address = ["Aleea Studentilor", "17", "RO"];
    
var list = function(friends){
    for(var key in friends){
        console.log(key);
    }
}

var search = function(name){
    for(var key in friends){
        if(friends[key].firstName === name){
            console.log("First Name: " + friends[key].firstName);
            console.log("Last Name: " + friends[key].lastName);
            console.log("Number: " + friends[key].number);
            console.log("Address: " + friends[key].address);
            return friends[key];
        }
        else{
            console.log("Found nobody");
        }
    }
}

var sch = prompt("Who are you searching for ?");
search(sch);


#2

Adri has no firstName property (you misspelled it)


#3

thank you ... can't believe i missed it


#4