What are the array detection non-mutation methods?

Posted by Jennifer | Updated on

The methods which do not mutate the original array but always return a new array are called non-mutation methods.

Below are the list of non-mutation methods:

1. filter()
2. concat()
3. slice()

For example, lets take a todo list where it replaces the old array with new one based on status filter,

This approach won’t re-render the entire list due to VueJS implementation.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers