undefined vs null
The difference between undefined and null.
Examples
Undefined Variable
A variable without a value is undefined.
let x;
console.log(x); // undefined
console.log(typeof x); // undefinedNull Value
Null represents an intentional absence of any object value.
let person = null;
console.log(person); // null
console.log(typeof person); // objectTest Your Knowledge
JavaScript Quiz
No quiz available for this topic yet.