Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up

What does Array.prototype.slice() do?

  1. A Removes elements from the array in place
  2. B Returns a shallow copy of a portion of the array without modifying it
  3. C Sorts the array
  4. D Joins array elements into a string
Answer

Returns a shallow copy of a portion of the array without modifying it

slice is non-mutating and returns a new array. splice, by contrast, modifies the original array in place.

All Javascript MCQs

Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up as