Search code examples
javascriptarraysmutable

Which JavaScript Array functions are mutating?


I am writing an Array-derived class in JavaScript and need to know which functions to overload so that I can be aware of changes made to the array.

I know Array.push() and Array.splice() are mutating. Is there a definitive list of any others?


Solution

  • You can find the list on MDN as Mutator methods (along with Accessor and Iteration methods):