Arrow Function은 ECMA Script 6부터 생긴 새로운 함수 선언 방식이다.
1. 형식
[변수 선언부][함수명] = [함수 인자값] => [함수 내부 코드]
const func1 = () => "Hello World!";
const func2 = num => num * 2;
2. 기존 함수와 비교
기존의 함수 선언 방식과 비교해보자
function func1() {
return "Hello World!";
}
function func2(num) {
return num * 2;
}