rtfeldman / seamless-immutable

Immutable data structures for JavaScript which are backwards-compatible with normal JS Arrays and Objects.
BSD 3-Clause "New" or "Revised" License
5.37k stars 195 forks source link

How does merge work? #204

Closed marek-sed closed 7 years ago

marek-sed commented 7 years ago

I have this jsfiddle https://jsfiddle.net/ejyvpbwx/12/

I merge map1 with same values that are already in map1.

why is the result false, is it a bug?

rtfeldman commented 7 years ago

It's because merge creates a new object. They may have the same contents, but they won't be reference equal (===) 🙂