try catch as code example
Example 1: try catch exception
First try block try to handle it
if not then catch block will handle it.
Finally block will executed regardless
of the outcome
Example 2: try/catch
var x = 7, y = 7;try { if(x == y){ throw "errorOne"; }else{ throw "errorTwo"; }} catch(e) { if(e == "errorOne"){ console.log("Same")} if(e == "errorTwo") console.log("Different)}