8. Victory!


var friends = new Object();
friends.bill = {
firstName: "Bill",
lastName: "Withers",
number: "1",
address: ['Canada', 'Canada', 'Canada', '226232']
friends.steve = {
firstName: "Steve",
lastName: "Higgens",
number: "2",
address: ['Detroit', 'Detroit', 'Detroit', '3387648']
var list = function(friends){
for(var key in friends) {
var name = ["Steve", "Bill"];
var search = function(name){
for (var key in friends){
if(friends[key].firstName === name){
return friends[key];
After using this same exact code for lesson 7 and having it show all the contact info for each person, in lesson 8 the console only displays


This line is not in the instructions. It is also not valid in global scope since that variable is a property of the window object and can only be set internally. name can only be used as a variable inside a function.

You are not using the data given in the instructions, so why should we take this seriously?


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