We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 29453ab commit d368a7bCopy full SHA for d368a7b
1 file changed
functions/IIFE.js
@@ -11,11 +11,19 @@ test();
11
console.log("What is IIFE Again?");
12
})(); // last brackets are to pass argument
13
14
+(function (name) {
15
+ console.log(`Hi There, ${name}`);
16
+})("rakib");
17
+console.log("---------------------");
18
+
19
const sum = (function sum() {
20
return 10 * 10;
21
})();
22
console.log(sum);
23
24
+(function (x, y) {
25
+ console.log(x * y);
26
+})(2, 3);
27
console.log("---------------------");
28
29
const user = (function () {
@@ -29,3 +37,11 @@ const info = (function () {
37
return `Hello ${user.name}`;
30
38
31
39
console.log(info);
40
41
+const myFunction = (function () {
42
+ const hi = "Hi!";
43
+ return function () {
44
+ console.log(hi);
45
+ };
46
+})();
47
+myFunction();
0 commit comments