Learn JavaScript

Lesson 4 of 9 · Objects, Destructuring, Spread and JSON

Module 8 · Objects, Destructuring, Spread and JSON

When to Use an Object: Against a Map, an Array of Pairs and a Class

Free with an accountReading

Kenji is reviewing a pull request. It stores a bus company's seats three different ways in three files. One file keeps an object from a passenger's name to a seat. Another keeps a Map. A third keeps an array of [name, seat] pairs and searches it with find. All three work on the test data. Kenji has to say which one should stay, and why.

Checking what this lesson needs for you…

What is inside When to Use an Object: Against a Map, an Array of Pairs and a Class

  1. Two jobs that look alike
  2. An object against a Map
  3. An object against an array of pairs
  4. An object against a class
  5. Choosing by four questions
  6. The comparison table