1. What is the output of console.log(typeof null)?
a) “object”
b) “null”
c) “undefined”
d) “number”
2. Which keyword is used to declare a constant in JavaScript?
a) var
b) const
c) let
d) define
3. What will console.log(2 + ‘2’) output?
a) 4
b) 22
c) “4”
d) Error
4. Which method is used to convert a JSON string into a JavaScript object?
a) JSON.parse()
b) JSON.stringify()
c) JSON.convert()
d) JSON.toObject()
5. Which symbol is used for strict equality in JavaScript?
a) ==
b) ===
c) !=
d) !==
6. What does the Array.prototype.push() method do?
a) Adds an element to the beginning of an array
b) Adds an element to the end of an array
c) Removes the last element of an array
d) Sorts the array
7. Which of the following is not a JavaScript data type?
a) undefined
b) number
c) float
d) boolean
8. How do you write a comment in JavaScript?
a) <!– comment –>
b) // comment
c) # comment
d) ** comment **
9. What is the correct way to write an arrow function?
a) function => () {}
b) () -> {}
c) () => {}
d) => () {}
10. Which function is used to delay code execution in JavaScript?
a) delay()
b) setInterval()
c) setTimeout()
d) wait()
11. What does NaN stand for?
a) Not a Number
b) Not a Name
c) Null and None
d) New as Needed
12. Which scope does let have?
a) Function scope
b) Global scope only
c) Block scope
d) Static scope
Sign in to your account