DEV Community

Discussion on: JavaScript Quiz Question #2: A Set of Objects

Collapse
 
timhlm profile image
moth

A!

This is because in JS Objects are passed by reference instead of value.

Just for fun, one of my first packages on npm was to make a superset of Set that included functionality allows you to do this by reference.

npmjs.com/package/spicy-set