Y

Yashika • 3.75K Points
Extraordinary

Q. What will be the output obtained by "shift ()" in the given code of JavaScript?

Code:
var a =[];  
a.unshift(5);  
a.unshift(22);  
a.shift();  
a.unshift(3,[4,5]);  
a.shift();  
a.shift();  
a.shift();  
  • (A) Exception is thrown
  • (B) [4,5]
  • (C) [3,4,5]
  • (D) 5

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.