Js traverses the array, which methods can change the original array, such as map,foreach,filter, and so on.

such as the question, I am a little confused now

Nov.03,2021

splice can change the original array, but instead of traversing, adding, deleting and replacing, this is all done on the original array.


look at document ah. For such a problem, there is a difference between what others tell you and reading the document yourself. The documents are all written.


look at the document and self-test memory will not know?
A generate a new array, a change to the original array
just sum up


do not memorize, when used Baidu on the line, with more will remember. Do not deliberately memorize, useless?


map and filter will not change the original array.


sort method

Menu