What does `Array.prototype.splice(1, 1)` do on `[1, 2, 3, 4]`?

JavaScript Professional Easy

JavaScript Professional — Easy

What does `Array.prototype.splice(1, 1)` do on `[1, 2, 3, 4]`?

Key points

  • The method modifies the original array
  • The first parameter is the starting index
  • The second parameter is the number of elements to remove
  • The method returns the removed elements
  • The array is mutated in place

Ready to go further?

Related questions