JavaScript MCQ Quiz | Set – 2

Share your love
127
Created on By
Piyush Patil

JavaScript Quiz | Set - 2

1 / 20

Javascript is an _______ language?

2 / 20

Which of the following keywords is used to define a variable in Javascript?

3 / 20

Which of the following methods is used to access HTML elements using Javascript?

4 / 20

Which of the following is not a JavaScript reserved word?

5 / 20

What is the output of the following code?

var a = 10;var b = "20";var c = 30;console.log(a + b + c);

 

6 / 20

What is the purpose of the 'break' statement in JavaScript?

7 / 20

What is the difference between 'let' and 'var' in JavaScript?

8 / 20

Which of the following is not a valid way to declare a JavaScript function?

9 / 20

What is the output of the following code?

var a = [1, 2, 3];console.log(a instanceof Array);

 

10 / 20

What is the difference between 'null' and 'undefined' in JavaScript?

11 / 20

What is the output of the following code?

var a = 10;

function myFunction() {

console.log(a);

var a = 20;

}

myFunction();

12 / 20

What is the output of the following code?

console.log(typeof [] === "object");

 

13 / 20

What is the difference between 'const' and 'let' in JavaScript?

14 / 20

What is the output of the following code?

console.log(+"5");

 

15 / 20

Which of the following is not a valid JavaScript event handler?

16 / 20

What is the output of the following code?

console.log("2" + 2);

 

17 / 20

What is the difference between '== and '!=' operators in JavaScript?

18 / 20

What is the difference between '===' and '!==' operators in JavaScript?

19 / 20

Which of the following is a valid JavaScript method to remove an element from an array?

20 / 20

What is the output of the following code?

console.log(typeof NaN === "number");

 

Your score is

The average score is 51%

0%

Share your love