diff options
| author | t7yang <t7yang@gmail.com> | 2022-01-10 08:38:08 +0800 |
|---|---|---|
| committer | Irvin <irvinfly@gmail.com> | 2022-02-16 02:35:54 +0800 |
| commit | f45e9e070c93ebbd83d488bdd775987a4d75c201 (patch) | |
| tree | aacef5edaf768a188cadc46860f5b6aaa74f39ef /files/zh-tw/web/javascript/reference/statements/let | |
| parent | 8ccfa93045a6c119303566370999f59a0aae3b25 (diff) | |
| download | translated-content-f45e9e070c93ebbd83d488bdd775987a4d75c201.tar.gz translated-content-f45e9e070c93ebbd83d488bdd775987a4d75c201.tar.bz2 translated-content-f45e9e070c93ebbd83d488bdd775987a4d75c201.zip | |
fix yari h2m dry run errors
Diffstat (limited to 'files/zh-tw/web/javascript/reference/statements/let')
| -rw-r--r-- | files/zh-tw/web/javascript/reference/statements/let/index.html | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/files/zh-tw/web/javascript/reference/statements/let/index.html b/files/zh-tw/web/javascript/reference/statements/let/index.html index f3170bb603..7c0b50b552 100644 --- a/files/zh-tw/web/javascript/reference/statements/let/index.html +++ b/files/zh-tw/web/javascript/reference/statements/let/index.html @@ -165,8 +165,8 @@ let i = 10;</pre> <h3 id="Another_example_of_temporal_dead_zone_combined_with_lexical_scoping">Another example of temporal dead zone combined with lexical scoping</h3> -<p>Due to lexical scoping, the identifier<strong> "foo"</strong> inside the expression <code>(foo + 55)</code> evaluates to the <u>if block's foo</u>, and <strong>not</strong> the <u>overlying variable foo</u> with the value of 33.<br> - In that very line, the <u>if block's "foo"</u> has already been created in the lexical environment, but has not yet reached (and <strong>terminated</strong>) its initialization (which is part of the statement itself): it's still in the temporal dead zone.</p> +<p>Due to lexical scoping, the identifier<strong> "foo"</strong> inside the expression <code>(foo + 55)</code> evaluates to the <em>if block's foo</em>, and <strong>not</strong> the <em>overlying variable foo</em> with the value of 33.<br> + In that very line, the <em>if block's "foo"</em> has already been created in the lexical environment, but has not yet reached (and <strong>terminated</strong>) its initialization (which is part of the statement itself): it's still in the temporal dead zone.</p> <pre class="brush: js example-bad">function test(){ var foo = 33; @@ -176,7 +176,7 @@ let i = 10;</pre> } test();</pre> -<p>This phenomenon may confuse you in a situation like the following. The instruction <code>let n of n.a</code> is already inside the private scope of the <u>for loop's block</u>, hence the identifier<strong> "n.a"</strong> is resolved to the property 'a' of the <u>'n' object located in the first part of the instruction itself</u> ("let n"), which is still in the temporal dead zone since its declaration statement has not been reached and <strong>terminated</strong>.</p> +<p>This phenomenon may confuse you in a situation like the following. The instruction <code>let n of n.a</code> is already inside the private scope of the <em>for loop's block</em>, hence the identifier<strong> "n.a"</strong> is resolved to the property 'a' of the <em>'n' object located in the first part of the instruction itself</em> ("let n"), which is still in the temporal dead zone since its declaration statement has not been reached and <strong>terminated</strong>.</p> <pre class="brush: js example-bad">function go(n) { // n here is defined! |
