JSFiddle - React, Tailwind, and code Playground
HTML
<script>
function myFunction()
{
try {
var a = 20 / f;
}
catch (err) {
alert(err);
}
}
</script>
<h2>Javascript - Simple Error HandlingException</h2>
<button type="button" onclick="myFunction();">Test Error</button>