We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e7918e4 commit 83e8ff2Copy full SHA for 83e8ff2
part5 (Functions)/AdvanceFunctions/03_arrow.functions.js
@@ -0,0 +1,19 @@
1
+/*
2
+:INFO: 🏹 What is an Arrow Function?
3
+Arrow functions are a concise syntax for writing functions introduced in ES6. They are great for writing short functions and callbacks.
4
+*/
5
+
6
+// Syntax
7
+const functionName = (parameters) => {
8
+ console.log("Hi");
9
+};
10
11
+// Example
12
+const greet = (name) => {
13
+ console.log(`Hello, ${name}`);
14
15
+greet("Rafay");
16
17
+// One-liner return (implicit return)
18
+const square = n => n * n;
19
+console.log(square(5));
0 commit comments