Exercise 12.5

This commit is contained in:
Karan
2021-11-25 19:23:30 +05:30
committed by GitHub
parent c9eb782c9f
commit d54035d3e3
+15
View File
@@ -0,0 +1,15 @@
function test(val) {
try {
if (isNaN(val)) {
throw "Not a number";
} else {
console.log("Got number");
}
} catch (e) {
console.error(e);
} finally {
console.log("Done " + val);
}
}
test("a");
test(100);