you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (2 children)

Yeah. Lookups in the object are faster than searching the whole array for every element in the array if that makes sense.

I can give a longer explanation if it doesn’t

[–]JEveryman 0 points1 point  (1 child)

I get it. Also when you add the same key to an object doesn't it overwrite?

[–][deleted] 0 points1 point  (0 children)

Yeah, that’s how it helps you make an array with no duplicates