Comparing null and undefined in Javascript


Distinguish between null (explicit absence of value) and undefined (value not assigned).

Source Code

let a = null;
let b;
console.log(a); // null
console.log(b); // undefined
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments