From e51930b5d780a3658073067dbc36b73561dcf41f Mon Sep 17 00:00:00 2001 From: Karan <50290386+Sonawane-Karan26@users.noreply.github.com> Date: Wed, 24 Nov 2021 20:51:14 +0530 Subject: [PATCH] Exercise 6.3 --- Chapter 6/Exercise 6.3 | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Chapter 6/Exercise 6.3 diff --git a/Chapter 6/Exercise 6.3 b/Chapter 6/Exercise 6.3 new file mode 100644 index 0000000..f5aeb4f --- /dev/null +++ b/Chapter 6/Exercise 6.3 @@ -0,0 +1,11 @@ +const val1 = 10; +const val2 = 5; +let operat = "-"; +function cal(a, b, op) { + if (op == "-") { + console.log(a — b); + } else { + console.log(a + b); + } +} +cal(val1, val2, operat);