JavaScript Quiz Questions and Answers 1
Question 1 What is the output of the following code? console.log(typeof NaN); a) “number”b) “string”c) “undefined”d) “NaN” Answer: a) “number” Explanation: In JavaScript, NaN (Not-a-Number) is actually of the type number. This is a special value that results from operations that don’t yield a valid number. Question 2 What does the following code snippet do? … Read more