There's Something About Mary's...Properties ("More People" wording Q: accessing value via array vs object)


#1

Not sure if my word choice is correct either (ironic, I know), but the instructions for this lesson are as follows:

  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.

My question is whether step 3 should include some kind of specification/requirement to use the array?

I checked the hint to see and it was about accessing objects in an array...
Then again I'd tried printing using the mary object directly (just to see) and it passed, so does this lesson care which way you print Mary's number or...?

frisby


https://www.codecademy.com/courses/building-an-address-book/0/2?curriculum_id=506324b3a7dffd00020bf661#


#2

@msfrisby,
The code-checker compares
the =output= given with contacts[1].phoneNumber


#3

Thank you, @leonhard.wettengmx.n. I thought that could be the case but wasn't sure. Since we went ahead with creating the array I was wondering if we should be forced to use it by the checker.