Perhaps it’s also useful to highlight which method creates a copy of the array, and which ones alters the original array. I mean I can tell by reading the code, but thought it should be highlighted since it’s one of the main consideration to choosing a method. The others being speed (which can be subjective and requires more elaboration, but definitely makes it more informative), and readability (self explanatory).
For example, the delete operator iirc is slow and most of the time assigning to undefined or null is better if the use-case allows.
Great info thanks.
Perhaps it’s also useful to highlight which method creates a copy of the array, and which ones alters the original array. I mean I can tell by reading the code, but thought it should be highlighted since it’s one of the main consideration to choosing a method. The others being speed (which can be subjective and requires more elaboration, but definitely makes it more informative), and readability (self explanatory).
For example, the
delete
operator iirc is slow and most of the time assigning to undefined or null is better if the use-case allows.Great suggestion! I will surely add the information about mutability and immutability.