In JavaScript, I understand why one would use Object.freeze() on an array or object, as it prevents shallow modification to anything contained within it, but is there any reason to use it on something else? A Boolean, String, RegExp, Number, a custom class?
Specifically, I am wondering about anonymous functions, although anything I learn here will probably be of use to me somewhere along my road.