Loading...
Loading...
By continuing to use the platform, you accept the terms of the Privacy Policy and the use of cookies.
👋 Hi! I'm Dastan, author of Hack Frontend. Always open to professional networking => connect with me on LinkedIn.
In JavaScript, null and undefined are primitive data types used to indicate the absence of a value, but they have different meanings and use cases.
let x; // x is undefined because we didn't assign a value
console.log(x); // undefined
let y = null; // y is "nothing" because we decided so
console.log(y); // null