Wait but why?

  • Objects in JavaScript sort of work like Hash Maps
  • You can add (and delete) properties as needed
  • Property names can be arbitrary strings
  • HashMap lookups are slower than "class" property lookups
  • Classes "know" what properties they have and where they are in memory

15 / 24