M
Q. Consider the following code snippet : var a = []; a.unshift(1); a.unshift(22); a.shift(); a.unshift(3,[4,5]); a.shift(); a.shift(); a.shift(); The final output for the shift() is
The unshift() and shift() methods behave much like push() and pop(), except that they insert and remove elements from the beginning of an array rather than from the end. unshift() adds an element or elements to the beginning of the array, shifts the existing array elements up to higher indexes to make room, and returns the new length of the array. shift() removes and returns the first element of the array, shifting all subsequent elements down one place to occupy the newly vacant space at the start of the array.
You must be Logged in to update hint/solution
Q. The Closure Compiler was introduced by
Q. What is the purpose of the parameter $name ?
Q. One of the special feature of an interpreter in reference with the for loop is that
Q. What will be the output of the following JavaScript code?
Q. What is the type of datatype the async attribute optionally accepts?
Q. When is JavaScript called obtrusive?
Q. What kind of work is being performed in the following given part of JavaScript's code?
Discusssion
Login to discuss.