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.
2 parents ef7c319 + 1287bfd commit 298255fCopy full SHA for 298255f
docs/JavaScript_Advance/arrow_function.md
@@ -1 +1,23 @@
1
-# Arrow Function
+# Arrow Function
2
+An arrow function expression is a syntactically compact alternative to a regular function expression.
3
+
4
+Example:
5
+```javascript
6
+// Regular function
7
+function greet(name){
8
+ console.log("Hello " + name);
9
+}
10
11
+// Arrow function equivalent
12
+const greet = name => {
13
+ console.log("Hello " + name)
14
15
+```
16
+Both functions above are equivalent to each other.
17
18
+If we have more than one function argument then we should put them in paranthesis like this:
19
20
+const exampleFunc = (name,age,eyeColor) => {
21
+ // ...
22
23
0 commit comments