Skip to content

Commit 3e27d18

Browse files
feat: add anonymous functions
1 parent 83e8ff2 commit 3e27d18

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
INFO: 🔍 What is an Anonymous Function?
3+
An anonymous function is a function without a name.
4+
Unlike named functions these are often used as values, usually when:
5+
1. Passing a function as an argument
6+
2. Assiging to variables
7+
3. Using in array methods like map, forEach, etc.
8+
*/
9+
10+
// Syntax
11+
function() {
12+
console.log("hi")
13+
};
14+
15+
// Example
16+
const greet = function() {
17+
console.log("Hello!");
18+
}
19+
greet();

0 commit comments

Comments
 (0)