Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion docs/JavaScript_Advance/arrow_function.md
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
# Arrow Function
# Arrow Function
An arrow function expression is a syntactically compact alternative to a regular function expression.

Example:
```javascript
// Regular function
function greet(name){
console.log("Hello " + name);
}

// Arrow function equivalent
const greet = name => {
console.log("Hello " + name)
}
```
Both functions above are equivalent to each other.

If we have more than one function argument then we should put them in paranthesis like this:
```javascript
const exampleFunc = (name,age,eyeColor) => {
// ...
}
```