Skip to content

Latest commit

 

History

History
18 lines (11 loc) · 407 Bytes

File metadata and controls

18 lines (11 loc) · 407 Bytes

Lesson 29: Objects

Key-value collections — the core data structure.

What you'll learn

  • create with {}; keys are strings (or symbols)
  • access with dot obj.key or bracket obj['key']
  • methods are functions stored as properties
  • shorthand: { name } instead of { name: name }

Example

See examples/.

Exercise

Model a book object with title, author, and a summary() method.