Skip to content

Commit bdbb83b

Browse files
committed
config iife
1 parent df26e06 commit bdbb83b

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

js_basics/iife.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)