JSFiddle - React, Tailwind, and code Playground
JavaScript
//THIS WORKS AND RETURN FALSE
alert(typeof sdfsdfsdfsdf !== 'undefined');
//THIS GIVES AN ERROR, WHY?
//Uncaught ReferenceError: sdfsd is not defined
function isDefined(value) {
alert(typeof value !== 'undefined' && value !== null)
}
isDefined(sdfsd);