Which of the following methods mutates the original array?
- map()
- filter()
- concat()
- reduce()
The concat() method is used to concatenate two or more arrays and returns a new array. It does not mutate the original array. In contrast, methods like map(), filter(), and reduce() can modify the original array, so they should be used with caution.
Loading...
Related Quiz
- The mechanism of closing over variables is a core concept in ________ programming in JavaScript.
- When a function expression is made async, it returns a ______.
- In JavaScript, you can add a new property to an object by simply assigning a value to it with the _________ operator.
- You are debugging a JavaScript application, and you find a variable that seems to be available even after its block has finished executing. What concept of JavaScript allows this to happen?
- What does the term "scope" refer to in JavaScript?