diff --git a/1-js/06-advanced-functions/04-var/article.md b/1-js/06-advanced-functions/04-var/article.md index a07b82b8e7..f53f244aa9 100644 --- a/1-js/06-advanced-functions/04-var/article.md +++ b/1-js/06-advanced-functions/04-var/article.md @@ -85,22 +85,22 @@ alert(phrase); // Error: phrase is not defined 위에서 살펴본 바와 같이, `var`는 `if`, `for` 등의 코드 블록을 관통합니다. 아주 오래전의 자바스크립트에선 블록 수준 렉시컬 환경이 만들어 지지 않았기 때문입니다. `var`는 구식 자바스크립트의 잔재이죠. -## "var" tolerates redeclarations +## "var"는 재선언을 용인합니다. -If we declare the same variable with `let` twice in the same scope, that's an error: +같은 변수를 동일한 스코프에서 `let`과 두 번 선언한다면 에러입니다. ```js run let user; let user; // SyntaxError: 'user' has already been declared ``` -With `var`, we can redeclare a variable any number of times. If we use `var` with an already-declared variable, it's just ignored: +`var`를 사용하면 같은 변수를 여러 번 재선언 할 수 있습니다. 이미 선언된 변수에 `var`를 사용하면 무시됩니다. ```js run var user = "Pete"; -var user = "John"; // this "var" does nothing (already declared) -// ...it doesn't trigger an error +var user = "John"; // 이 "var"는 아무것도 하지 않습니다 (이미 선언됨). +// 에러가 발생하지 않습니다. alert(user); // John ``` pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy