Displaying People


#1

var bob = {
firstName: "Bob",
lastName: "Jones",
phoneNumber: "(650) 777-7777",
email: "bob.jones@example.com"
};

var mary = {
firstName: "Mary",
lastName: "Johnson",
phoneNumber: "(650) 888-8888",
email: "mary.johnson@example.com"
};

var contacts = [bob, mary];

// printPerson added here
var printPerson = function(person) {
console.log(person.firstName + " " + person.lastName);
var myArray = [0, 1, 2];

console.log(myArray[1]);
console.log("Bob Jones")
printPerson()
};

Oops, try again. Did you create a function called printPerson?

please help me


#2

Hey man
Thats my code and is working so check it out, just change your code after
"//printPerson added here"

printPerson = function(person){
console.log(person.firstName +" "+ person.lastName);
}

printPerson(contacts[0]);
printPerson(contacts[1]);


#3

hey what did you do for methdos

this is my code

function Circle (radius) {
this.radius = radius;
this.area = function () {
return Math.PI * this.radius * this.radius;

};
var square = new Object();
square.sideLength = 6;

square.calcPerimeter = function(){
console.log(this.sideLength * this.sideLength * 4);
};

square.calcArea = function(x, y) {
console.log(this.sideLength * this.sideLength);
};

square.calcPerimeter();
square.calcArea();

};
var myCircle = new Circle(5)
myCircle.perimeter=function(){
return 2*(Math.PI*this.radius);
};
console.log(myCircle.perimeter());

can you hlep me