0 votes
in Vue.JS by (883 points)
recategorized by

What are the array detection non-mutation methods?

1 Answer

0 votes
by (883 points)

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,

vm.todos = vm.todos.filter(function (todo) {
  return todo.status.match(/Completed/)
})
Click here to read more about Vue JS
Click here to read more about Insurance

Related questions

0 votes
asked Oct 21, 2019 in Vue.JS by Tate (883 points)
0 votes
asked Oct 21, 2019 in Vue.JS by Tate (883 points)
...