We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent df26e06 commit bdbb83bCopy full SHA for bdbb83b
1 file changed
js_basics/iife.js
@@ -0,0 +1,16 @@
1
+//Immediately Invoked Function Expressions
2
+// An IIFE (Immediately Invoked Function Expression) in JavaScript
3
+// is a way to create a function expression and immediately execute it.
4
+// It's often used to create a separate scope for variables and functions to
5
+// avoid polluting the global scope.
6
+(function chai(){
7
+ console.log("Hello krish");
8
+})();
9
+// where to stop context use ; otherwise anoth iife don't work
10
+(() => {
11
+ console.log("Hello krish two");
12
13
+
14
+((name) => {
15
+ console.log(`Hello ${name}`);
16
+})('Abhi')
0 commit comments