화살표 함수
화살표 함수
선언적 함수
func1 = () => {
document.write("1. 함수가 실행되었습니다. <br>");
};
func1();익명 함수
let func2 = () => {
document.write("2. 함수가 실행되었습니다. <br>");
};
func2();return문 함수
let func3 = () => {
let str = "3. 함수가 실행되었습니다.<br>";
return str;
};
let result = func3();
document.write(func3());매개변수가 있는 함수
괄호 생략
괄호 + 리턴 + 중괄호 생략
2개 이상 변수가 있을 때는 사용이 불가하다.
Last updated
Was this helpful?