Meet Bob. Bob is our friend. But how do we get in touch with Bob?
Look at the code in the editor. We have Bob's information stored in an associative arraynamed bob. bob has a property calledfirstName which has a value of "Bob". Similarly, it has properties lastName,phoneNumber and email which each have values.
To access the values for each property we write array.property. Check out line 8 where we log to the console bob.firstName.
Instructions
var bob = {
firstName: "Bob",
lastName: "Jones",
phoneNumber: "(081) 777-777",
email: "hh.jones@example.com"
};
console.log(bob.firstName);
console.log(bob.lastName);
console.log(bob.email);
No comments:
Post a Comment