Reputation: 1744
Curently if I have m.set(someArray)
where m is a Map
, it will try to convert someArray
to Immutable List
. How do I disable this behaviour?
Upvotes: 0
Views: 55
Reputation: 72857
Pass a copy of the array, instead:
m.set(someArray.slice());
Note that, if the array contains reference values (objects, arrays), the references are copied. .slice()
is only a shallow copy.
Upvotes: 2