Which array method adds elements to the beginning of an array?

  • push()
  • unshift()
  • concat()
  • splice()
The unshift() method is used to add elements to the beginning of an array. It's particularly useful when you want to insert one or more elements at the start of an existing array without affecting the order of the existing elements. Unlike push(), which adds elements to the end, unshift() works at the beginning.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *