Js Array.prototype.map() happens to be mutable?
问题 Why would the map method mutate the original array when its initial purpose is to create a new array ? I have an array of object which I pass to a pure function which in turn maps the given array and return a new one. Then I notice that the original array was also changed.. I understand the concept that Object in Js are passed by reference and all but still cant quite grab why would the implementation of map would mutate the original array, kinda beats the purpose IMO. var initialArray = [ {