JSFiddle - React, Tailwind, and code Playground
HTML
<p id="output"></p>
JavaScript
function isUnset(inp) {
return (typeof inp === 'undefined')
}
try {
if (isUnset(brokenAnswer)) {
document.getElementById('output').innerHTML = 'If the answer was ok, we would see this message';
}
catch(error) {
document.getElementById('output').innerHTML = '..but the browser throws an error :( ' + error;
}