From d54035d3e3f0dc1a634d50f2f3cb2bc779006db9 Mon Sep 17 00:00:00 2001 From: Karan <50290386+Sonawane-Karan26@users.noreply.github.com> Date: Thu, 25 Nov 2021 19:23:30 +0530 Subject: [PATCH] Exercise 12.5 --- Chapter 12/Exercise 12.5 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Chapter 12/Exercise 12.5 diff --git a/Chapter 12/Exercise 12.5 b/Chapter 12/Exercise 12.5 new file mode 100644 index 0000000..42613ec --- /dev/null +++ b/Chapter 12/Exercise 12.5 @@ -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);