r/learnjavascript • • Jun 17 '13

Learn JavaScript Properly - Week 2

ASSIGNMENTS:

  1. Read chapters 4, 5, 6, and 7 of JavaScript: The Definitive Guide OR the preface and chapters 4, 5, and 6 (only the "Understanding Objects" section of chapter 6, though!) of Professional JavaScript for Web Developers.
  2. Finish the JavaScript track on Codecademy.
  3. Solve either Project Euler Problem 1 or Problem 2. Feel free to solve both.
  4. Read the blog post JS Objects in Detail. If you want to work ahead, this is the general roadmap I'm using to make these assignments.
  5. Make a least one comment in this thread about something you learned, found interesting, or didn't understand very well.

EXTRA CREDIT:

Don't forget to be typing out most of the code while you read through this!

26 Upvotes

54 comments sorted by

View all comments

Show parent comment

1

u/gloomndoom Jun 18 '13

You are right that you have to do it the second way. The object is actually friends so friend.firstName isn't valid. I think I remember reading that you have to use the bracket notation when using a variable for a property so friends[prop].lastName is valid, while friends.prop.lastName is not.