JSFiddle - React, Tailwind, and code Playground
JavaScript
// This will work as expected.
var x;
if (x === undefined) {
console.log('x is undefined');
}
// This will throw an error.
if (y === undefined) {
console.log('y is undefined');
}
// This will work as expected.
var x;
if (x === undefined) {
console.log('x is undefined');
}
// This will throw an error.
if (y === undefined) {
console.log('y is undefined');
}