Question 174

In JavaScript, what does [1, 2, 3].push(4) return?

  1. Aundefined
  2. B3
  3. C[1, 2, 3, 4]
  4. D4 (the new length)
Show answerHide answer

Correct answer: (D) 4 (the new length)

Explanation

push() returns the new length of the array.

From DSSSB TGT Computer Science Full Mock Test 4

This is question 174 of DSSSB TGT Computer Science Full Mock Test 4. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.