Question 2
Back to Exercise
What does arr.push("x") return?
- A The new length of the array Correct
- B The updated array
- C "x"
- D undefined
Correct Answer: Option A
push and unshift return the new length. A common bug is arr = arr.push(x), which replaces the array with a number.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!