Are tired of Errors?
Lets learn error handling in JavaScript in 60 seconds.
There are multiple types of error:
Syntax error, reference error Type Error, Range Error
we can deal with this by wrapping the block of code in try block
and catch the potential errors in catch block. This will prevents you program from crashing.
Beside the generic catch block you can catch specific type of error and preform action according to it.
There is one more thing the finally block.
itβs useful as it gets exceuted regardless of weather an error occurs or not.
Itβs commonly use to perform cleanup operation.
This Is TI, SAYONARA



Top comments (0)