JavaScript Multiple choices


Total available count: 50
Subject - JavaScript Frameworks
Subsubject - JavaScript

var data = [ "X", "Y", "Z" ];data.shift(); What is the output of this code?


 

 

 

 



A


Solution:-

The shift() method removes the first element and returns that removed element from an array. This method changes the length of the array.

Syntax:-

array.shift()

Example:-
Remove the first item of an array:

var courses = ["HTML", "SQL", "CSS", "Oracle"];
fruits.shift();

The above code output will be as below:

SQL, CSS, Oracle




Next 5 multiple choice(s)

1

Pick the difference between pop() and shift() methods in JavaScript?

2

Escape characters are not used along with which characters in JavaScript?

3

Which is not escape characters in JavaScript?

4

Pick the difference between the alert box and the confirmation box?

5

What is the use of 0 in Void(0) in JavaScript?

Comments