Array Methods
10 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which method adds items to the end of an array?

  • arr.unshift()
  • arr.push() (correct)
  • arr.pop()
  • arr.shift()

Which method extracts an item from the end of an array?

  • arr.pop() (correct)
  • arr.push()
  • arr.shift()
  • arr.unshift()

Which method extracts an item from the beginning of an array?

  • arr.pop()
  • arr.unshift()
  • arr.push()
  • arr.shift() (correct)

Which method adds items to the beginning of an array?

<p>arr.unshift() (D)</p> Signup and view all the answers

Which method can be used to insert, remove, and replace elements in an array?

<p>arr.splice() (C)</p> Signup and view all the answers

Which method can be used to delete an element from an array?

<p>arr.splice() (B)</p> Signup and view all the answers

Which method can be used to add items to the end of an array?

<p>arr.push() (C)</p> Signup and view all the answers

Which method extracts an item from the beginning of an array?

<p>arr.shift() (C)</p> Signup and view all the answers

Which method can be used to add items to the beginning of an array?

<p>arr.unshift() (B)</p> Signup and view all the answers

Which method can be used to insert, remove, and replace elements in an array?

<p>arr.splice() (B)</p> Signup and view all the answers

More Like This

1D Array Methods Exercise
16 questions

1D Array Methods Exercise

PleasurableHeliotrope295 avatar
PleasurableHeliotrope295
JavaScript Array Methods and Scoping
48 questions
Use Quizgecko on...
Browser
Browser