while Set
is an Object, Object.freeze()
works on the object's properties, which evidently Map and Set do not use: eg
let m = new Map(); Object.freeze(m); m.set( 'key', 55); m.get( 'key' ) ==> 55
this is the behavior in Chrome, and I expect it's standard.
I understand that one could (sometimes) transform the Set or Map into a normal Object, and then freeze the object. but then key access changes between the unfrozen and frozen version.