This content originally appeared on DEV Community and was authored by Dharshini E
Understanding Arrow Functions, Callback Functions, and the Map Function in JavaScript
1. Arrow Functions:
- Arrow functions are a shorter way to write functions in JavaScript.
- They were introduced in ES6 and make the code cleaner and easier to read.
- It provides a shorter and more readable way to define functions, especially for anonymous functions or callbacks.
// Normal function
function add(a, b) {
return a + b;
}
// Arrow function
const addArrow = (a, b) => a + b;
console.log(add(2, 3)); // Output: 5
console.log(addArrow(2, 3)); // Output: 5
This content originally appeared on DEV Community and was authored by Dharshini E
Print
Share
Comment
Cite
Upload
Translate
Updates
There are no updates yet.
Click the Upload button above to add an update.

APA
MLA
Dharshini E | Sciencx (2025-09-09T02:40:37+00:00) Javascript – arrow function. Retrieved from https://www.scien.cx/2025/09/09/javascript-arrow-function/
" » Javascript – arrow function." Dharshini E | Sciencx - Tuesday September 9, 2025, https://www.scien.cx/2025/09/09/javascript-arrow-function/
HARVARDDharshini E | Sciencx Tuesday September 9, 2025 » Javascript – arrow function., viewed ,<https://www.scien.cx/2025/09/09/javascript-arrow-function/>
VANCOUVERDharshini E | Sciencx - » Javascript – arrow function. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/09/09/javascript-arrow-function/
CHICAGO" » Javascript – arrow function." Dharshini E | Sciencx - Accessed . https://www.scien.cx/2025/09/09/javascript-arrow-function/
IEEE" » Javascript – arrow function." Dharshini E | Sciencx [Online]. Available: https://www.scien.cx/2025/09/09/javascript-arrow-function/. [Accessed: ]
rf:citation » Javascript – arrow function | Dharshini E | Sciencx | https://www.scien.cx/2025/09/09/javascript-arrow-function/ |
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.