Which method creates a shallow copy of a portion of an array?

JavaScript Associate Easy

JavaScript Associate — Easy

Which method creates a shallow copy of a portion of an array?

Key points

  • slice() creates a copy without altering the original array.
  • splice() is used to remove or replace elements in an array.
  • copy() and chunk() are not standard array methods in JavaScript.

Ready to go further?

Related questions