JavaScript fundamentals / 07
Arrow functions
Write concise arrow functions, use an implicit return, and omit parentheses for a single simple parameter.
On this page
What is an arrow function?
An arrow function uses => in place of the function keyword. It can make a small function more concise, although not every function can be shortened in the same way.
Basic structure
The general form is:
const functionName = (parameter1, parameter2) => {
// Statements to execute
}
For example:
//example
const ong = (x, y) => {
return x + y
}
If the body only returns a single expression, we can omit both the braces and return:
//example
const ong = (x, y) => x + y
If the body contains additional statements, such as a separate console.log call before the return, it cannot be shortened in that same way.
A single parameter
When there is only one simple parameter rather than two, its parentheses can also be omitted:
// With one parameter
const ong = x => x + 1
Editorial note: this lesson focuses on syntax. Arrow functions also differ from ordinary functions in behavior, including their handling of
this, so they are not interchangeable in every situation. The generic syntax example's Korean placeholder names have been translated.
Moved here from Tistory
I migrated this post from my Korean Tistory blog, I am Jason Lee, to this website and translated it into English. My writing and projects now live together in one place.
The original publication date, code examples, and screenshots are preserved. Editorial notes clarify known issues in the original material.
Original post on Tistory English edition · Aug 30, 2026