What does typeof null return? a) “object” b) “null” c) “undefined” d) “string”
Which operator is used for strict equality comparison in JavaScript? a) == b) === c) = d) !==
What does NaN === NaN return? a) true b) false c) undefined d) NaN
What is the result of "5" + 3? a) 8 b) “53” c) “8” d) NaN
What is the correct way to define a function in JavaScript? a) function: myFunction() {} b) def myFunction() {} c) func myFunction() {} d) function myFunction() {}
Which keyword is used to declare variables in JavaScript? a) var b) let c) const d) All of the above
What will be the output of console.log(2 + 3 + "7")? a) “57” b) “12” c) “77” d) “23”
What is the result of 2 == "2"? a) true b) false c) undefined d) null
What is the purpose of Array.prototype.map() method in JavaScript? a) To filter elements from an array b) To modify each element of an array c) To check if any element satisfies a condition d) To concatenate two arrays
What is the correct way to comment multiple lines in JavaScript? a) /* Comment */ b) // Comment // c) d) \ Comment \
Which JavaScript method is used to remove the last element from an array? a) pop() b) shift() c) removeLast() d) splice()
What does the && operator do in JavaScript? a) Logical OR b) Logical AND c) Bitwise OR d) Bitwise AND
What is the result of "5" - 3? a) 2 b) “2” c) 8 d) NaN
Which function is used to parse a JSON string into a JavaScript object? a) JSON.parse() b) JSON.stringify() c) parseJSON() d) stringifyJSON()
Which method is used to find the index of the first occurrence of a specified value in a string? a) indexOf() b) search() c) findIndex() d) find()
What does the || operator do in JavaScript? a) Logical OR b) Logical AND c) Bitwise OR d) Bitwise AND
What is the output of typeof [1, 2, 3]? a) “array” b) “object” c) “list” d) “undefined”
How can you convert a string to uppercase in JavaScript? a) toUpperCase() b) upperCase() c) toUpper() d) upper()
Which method is used to add new items to the end of an array? a) push() b) unshift() c) add() d) append()
What is the result of typeof NaN? a) “number” b) “NaN” c) “undefined” d) “string”