Exercise 12.5

This commit is contained in:
Karan 2021-11-25 19:23:30 +05:30 committed by GitHub
parent c9eb782c9f
commit d54035d3e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

15
Chapter 12/Exercise 12.5 Normal file
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);