> For the complete documentation index, see [llms.txt](https://jangar6621.gitbook.io/javascript-jquery/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jangar6621.gitbook.io/javascript-jquery/undefined-2/undefined-7.md).

# 화살표 함수

## 화살표 함수(선언적 함수)

```javascript
func1 = () => {
    document.write("1. 함수가 실행되었습니다. <br>");
}
func1();

//1. 함수가 실행되었습니다.
```

## 화살표 함수(익명 함수)

```javascript
let func2 = () => {
    document.write("2. 함수가 실행되었습니다. <br>");
}
func2();

//2. 함수가 실행되었습니다.
```

## 화살표 함수(리턴문 함수)

```javascript
let func3 = () => {
    let str = "3. 함수가 실행되었습니다. <br>";
    return str;
}   
let result = func3();
document.write(result);

//3. 함수가 실행되었습니다.
```

## 화살표 함수(매개변수가 있는 함수)

```javascript
//매개변수가 있는 함수 + 리턴 +익명
let func4 = (str) =>{
    return str;
}
let result2 = func4("4. 함수가 실행되었습니다. <br>");
document.write(result2);

//4. 함수가 실행되었습니다.
```

## 화살표 함수(매개변수 괄호 생략)

```javascript
let func5 = str => {
    return str;
}
let result3 = func5("5. 함수가 실행되었습니다. <br>");
document.write(result3);

//5. 함수가 실행되었습니다.
```

## 화살표 함수(매개변수 괄호 + 리턴 생략)

```javascript
let func6 = str => str;

let result4 = func6("6. 함수가 실행되었습니다. <br>");
document.write(result4);

//6. 함수가 실행되었습니다.
```
