Welcome to your JavaScript Programming MCQ
1.
How do you check the type of a variable in JavaScript?
How do you check the type of a variable in JavaScript?
2.
What is the output of console.log(10 % 3); in JavaScript?
What is the output of console.log(10 % 3); in JavaScript?
3.
How do you declare a class in JavaScript?
How do you declare a class in JavaScript?
4.
How do you iterate through an array in JavaScript?
How do you iterate through an array in JavaScript?
5.
What is the purpose of else statement in JavaScript?
What is the purpose of else statement in JavaScript?
6.
What is the purpose of document.getElementById() in JavaScript?
What is the purpose of document.getElementById() in JavaScript?
7.
What does the Math.random() function return in JavaScript?
What does the Math.random() function return in JavaScript?
8.
What is the correct way to create a function in JavaScript?
What is the correct way to create a function in JavaScript?
9.
How do you declare a variable in JavaScript?
How do you declare a variable in JavaScript?
10.
How do you declare a switch statement in JavaScript?
How do you declare a switch statement in JavaScript?
11.
How do you declare a for...in loop in JavaScript?
How do you declare a for...in loop in JavaScript?
12.
How do you define a getter method in a JavaScript class?
How do you define a getter method in a JavaScript class?
13.
What is the output of console.log("Hello".charAt(1)); in JavaScript?
What is the output of console.log("Hello".charAt(1)); in JavaScript?
14.
How do you declare an async function in JavaScript?
How do you declare an async function in JavaScript?
15.
How do you define an object in JavaScript?
How do you define an object in JavaScript?
16.
How do you define a function that accepts parameters in JavaScript?
How do you define a function that accepts parameters in JavaScript?
17.
How do you open a new browser window with URL https://example.com in JavaScript?
How do you open a new browser window with URL https://example.com in JavaScript?
18.
What is the purpose of await keyword in JavaScript?
What is the purpose of await keyword in JavaScript?
19.
What is JavaScript primarily used for?
What is JavaScript primarily used for?
20.
What is the output of console.log("JavaScript".length); in JavaScript?
What is the output of console.log("JavaScript".length); in JavaScript?
21.
How do you add a new element to the end of an array array in JavaScript?
How do you add a new element to the end of an array array in JavaScript?
22.
How do you declare a try-catch block in JavaScript?
How do you declare a try-catch block in JavaScript?
23.
How do you declare an array in JavaScript?
How do you declare an array in JavaScript?
24.
How do you print "Hello, World!" in JavaScript?
How do you print "Hello, World!" in JavaScript?
25.
What is the purpose of null keyword in JavaScript?
What is the purpose of null keyword in JavaScript?
26.
How do you comment out a line in JavaScript?
How do you comment out a line in JavaScript?
27.
How do you declare a static method in a JavaScript class?
How do you declare a static method in a JavaScript class?
28.
How do you declare a template literal in JavaScript?
How do you declare a template literal in JavaScript?
29.
What is the purpose of if statement in JavaScript?
What is the purpose of if statement in JavaScript?
30.
How do you check if an array arr includes a specific element in JavaScript?
How do you check if an array arr includes a specific element in JavaScript?