Which JavaScript method adds an element to the end of an array?
-
A
pop()
-
B
push()
Correct answer
-
C
shift()
-
D
unshift()
12 views
Explanation
push() adds elements to the end of an array. Source: Standard JavaScript content (FBISE-aligned).
Reference
Asked in: Matric,FBISE
Doubts & discussion
Not sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ