Kevin Powell - CommunityKP-C
Kevin Powell - Communityβ€’3y agoβ€’
5 replies
rarrrrrr

error handling

<!DOCTYPE html>
<html>
<body>
</body>
<script>
try{
for(a = 2,a < 2;a++){
console.log(a);
} catch (err) {
console.log("Syntax Error Was Occured");
}
</script>
</html>

from above example there was syntax error on for loop then i try to catch the error and it doesn't work
Was this page helpful?