We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c1e996 commit f7989d3Copy full SHA for f7989d3
03_Basics/06_iife.js
@@ -0,0 +1,16 @@
1
+/* 6. IIFE (Immediately Invoked Function Expressions)
2
+
3
+Note: An IIFE in JavaScript is a function that is executed immediately
4
+after it's defined. It's typically used to create a private scope for variables
5
+and functions to avoid polluting the global namespace.
6
7
+Name IIFE, */
8
+(function chai(){
9
+ console.log(`DB Connected`);
10
+})(); /* Output: DB Connected
11
+Note: Using semicolon ; to end the first IIFE function.
12
13
+Simple IIFE, */
14
+((name) /* parameter */ => {
15
+ console.log(`DB Connected, ${name}`);
16
+})("Ayush") // argument | Output: DB Connected, Ayush
0 commit comments