Skip to content

Commit

Permalink
Merge pull request #939 from pipisebastian/pipisebastian
Browse files Browse the repository at this point in the history
23-1μž₯ μ‹€ν–‰ μ»¨ν…μŠ€νŠΈ - μž₯μ„œμœ€
  • Loading branch information
Ryan-Dia authored Dec 9, 2023
2 parents 5429ff0 + f1bd479 commit 3539640
Showing 1 changed file with 46 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
## πŸ’‘ 23.1 μ†ŒμŠ€μ½”λ“œμ˜ νƒ€μž…

- μ†ŒμŠ€μ½”λ“œ νƒ€μž…μ— 따라 -> μ†ŒμŠ€ μ½”λ“œ **평가** -> **μ‹€ν–‰** μ»¨νƒμŠ€νŠΈ 생성

- **μ „μ—­ μ½”λ“œ**
- μ „μ—­ μŠ€μ½”ν”„ 생성 (μ „μ—­ λ³€μˆ˜ 관리λ₯Ό μœ„ν•΄)
- μ „μ—­ λ³€μˆ˜/ν•¨μˆ˜λ₯Ό μ „μ—­ 객체의 ν”„λ‘œνΌν‹°/λ©”μ„œλ“œλ‘œ 바인딩 (μ°Έμ‘°ν•˜κΈ° μœ„ν•΄ μ „μ—­ 객체와 μ—°κ²°ν•˜λŠ” κ²ƒμž„)
- **ν•¨μˆ˜ μ½”λ“œ**
- 지역 μŠ€μ½”ν”„ 생성 (지역 λ³€μˆ˜, λ§€κ°œλ³€μˆ˜, arguments 객체 관리λ₯Ό μœ„ν•΄)
- 지역 μŠ€μ½”ν”„λ₯Ό μ „μ—­ μŠ€μ½”ν”„μ—μ„œ μ‹œμž‘ν•˜λŠ” μŠ€μ½”ν”„ 체인의 μΌμ›μœΌλ‘œ μ—°κ²°ν•΄μ•Ό 함
- **eval μ½”λ“œ**
- strict modeμ—μ„œ μžμ‹ λ§Œμ˜ λ…μžμ μΈ μŠ€μ½”ν”„ 생성
- **λͺ¨λ“ˆ μ½”λ“œ**
- λͺ¨λ“ˆλ³„λ‘œ 독립적은 μŠ€μ½”ν”„ 생성

## πŸ’‘ 23.2 μ†ŒμŠ€μ½”λ“œμ˜ 평가와 μ‹€ν–‰

- **μ†ŒμŠ€μ½”λ“œ 평가** + **μ†ŒμŠ€μ½”λ“œ μ‹€ν–‰** 2단계
![](https://velog.velcdn.com/images/pipi/post/31e99f3a-69a4-4fe1-b1a6-ed30382157a3/image.png)

```js

```

- **μ†ŒμŠ€μ½”λ“œ 평가**

- μ‹€ν–‰ μ»¨ν…μŠ€νŠΈ 생성
- λ³€μˆ˜/ν•¨μˆ˜ μ„ μ–Έλ¬Έ μ‹€ν–‰ -> μƒμ„±λœ λ³€μˆ˜/ν•¨μˆ˜ μ‹λ³„μžλ₯Ό <u>μ‹€ν–‰ μ»¨ν…μŠ€νŠΈκ°€ κ΄€λ¦¬ν•˜λŠ” μŠ€μ½”ν”„</u>에 등둝

- **μ†ŒμŠ€μ½”λ“œ μ‹€ν–‰**

- 선언문을 μ œμ™Έν•œ μ†ŒμŠ€μ½”λ“œκ°€ 순차적으둜 μ‹€ν–‰(λŸ°νƒ€μž„ μ‹œμž‘)
- μ†ŒμŠ€μ½”λ“œ 싀행에 ν•„μš”ν•œ 정보듀은 <u>μ‹€ν–‰ μ»¨ν…μŠ€νŠΈκ°€ κ΄€λ¦¬ν•˜λŠ” μŠ€μ½”ν”„</u>μ„œ μ–»λŠ”λ‹€. + μ†ŒμŠ€μ½”λ“œμ˜ μ‹€ν–‰κ²°κ³ΌλŠ” <u>μ‹€ν–‰ μ»¨ν…μŠ€νŠΈκ°€ κ΄€λ¦¬ν•˜λŠ” μŠ€μ½”ν”„</u>에 λ“±λ‘λœλ‹€.

- **λ™μž‘ μ˜ˆμ‹œ**
```js
var x;
x = 1;
```
- **μ†ŒμŠ€μ½”λ“œ 평가**
- λ³€μˆ˜ μ„ μ–Έλ¬Έ (`var x;`) μ‹€ν–‰.
- μ‹λ³„μž `x`λŠ” <u>μ‹€ν–‰ μ»¨ν…μŠ€νŠΈκ°€ κ΄€λ¦¬ν•˜λŠ” μŠ€μ½”ν”„</u>에 λ“±λ‘λ˜κ³ , `undefined`둜 μ΄ˆκΈ°ν™”λœλ‹€.
- **μ†ŒμŠ€μ½”λ“œ μ‹€ν–‰**
- λ³€μˆ˜ ν• λ‹Ήλ¬Έ (`x = 1;`) μ‹€ν–‰.
- μ΄λ•Œ, xκ°€ μ„ μ–Έλœ λ³€μˆ˜μΈμ§€ ν™•μΈν•˜κΈ° μœ„ν•΄ <u>μ‹€ν–‰ μ»¨ν…μŠ€νŠΈκ°€ κ΄€λ¦¬ν•˜λŠ” μŠ€μ½”ν”„</u>에 x λ³€μˆ˜κ°€ λ“±λ‘λ˜μ–΄ μžˆλŠ”μ§€ ν™•μΈν•œλ‹€.
- μ„ μ–Έλœ λ³€μˆ˜(μŠ€μ½”ν”„μ— λ“±λ‘λœ λ³€μˆ˜)라면 값을 ν• λ‹Ήν•˜κ³ , ν• λ‹Ή κ²°κ³Όλ₯Ό <u>μ‹€ν–‰ μ»¨ν…μŠ€νŠΈκ°€ κ΄€λ¦¬ν•˜λŠ” μŠ€μ½”ν”„</u>에 λ“±λ‘ν•œλ‹€!

0 comments on commit 3539640

Please sign in to comment.