Beginner JavaScript
Q12 / 100

What is the difference between null and undefined?

Correct! Well done.

Incorrect.

The correct answer is B) undefined means a variable is declared but not assigned; null is an intentional absence of value

B

Correct Answer

undefined means a variable is declared but not assigned; null is an intentional absence of value

Explanation

JavaScript sets uninitialized variables to undefined. null is explicitly assigned to represent "no value." typeof undefined === "undefined"; typeof null === "object".

Progress
12/100