Files
JavaScript-from-Beginner-to…/Chapter 12/Exercise 12.5
T
2021-11-25 19:23:30 +05:30

16 lines
283 B
Plaintext

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);