From 5ba3cd81d7777a5b7f7ee9acde6ca56007aaadc7 Mon Sep 17 00:00:00 2001 From: Karan <50290386+Sonawane-Karan26@users.noreply.github.com> Date: Wed, 24 Nov 2021 20:55:55 +0530 Subject: [PATCH] Exercise 6.5 --- Chapter 6/Exercise 6.5 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Chapter 6/Exercise 6.5 diff --git a/Chapter 6/Exercise 6.5 b/Chapter 6/Exercise 6.5 new file mode 100644 index 0000000..080af06 --- /dev/null +++ b/Chapter 6/Exercise 6.5 @@ -0,0 +1,17 @@ +let val = "1000"; + +(function () { + let val = "100"; // local scope variable + console.log(val); +})(); + +let result = (function () { + let val = "Laurence"; + return val; +})(); +console.log(result); +console.log(val); + +(function (val) { + console.log(`My name is ${val}`); +})("Laurence");