Objects and arrays task


#1

What is wrong with my code? Here are the instructions:

1.Create an object called mary. It has the same properties as bob. Her name is Mary Johnson, her phoneNumber is "(650) 888 - 8888" and her email is "mary.johnson@example.com".
2.Create an array called contacts. Put bob in first (at index 0), then mary (at index 1).
3.Write a console.log statement that prints out Mary's phone number.


#2

In your array you've declared two strings as your variables, rather than the objects.

var contacts = new Array("bob", "mary");

Should be:

var contacts = new Array(bob, mary);