Available Questions About JavaScript Quizzes
1. console.log(2 + '2');
"22"
"4"
22
4
2. What does typeof null return in JavaScript?
"object"
"null"
"undefined"
"number"
3. Which method is used to add elements to the end of an array in JavaScript?
pop()
shift()
push()
unshift()
4. console.log([] == []);
true
false
undefined
null
5. What is the purpose of the bind() method in JavaScript?
To create a new function with a specified this value and arguments
To immediately invoke a function
To define a method in an object
To bind an event listener to an element
6. What does the this keyword refer to in a JavaScript function?
The function itself
The global object
The object that owns the method
The parent object
7. console.log(0.1 + 0.2 === 0.3);
true
false
undefined
null
8. How do you declare a variable that is not accessible outside of a function in JavaScript?
var
let
const
let
9. console.log(1 + '1' - 1);
11
1
'1'
10
10. What is the purpose of the setTimeout() function in JavaScript?
To delay the execution of a function by a specified time
To execute a function immediately
To set a time interval for repeating execution
To wait for user input