Skip to content

Commit

Permalink
fix(function-scope): fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
azu authored Feb 5, 2024
1 parent 325c600 commit 5d9f5a6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/basic/function-scope/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,8 @@ console.log(typeof foo === "undefined"); // => true
次の例では`createCounter`関数が、関数内で定義した`increment`関数を返しています。
その返された`increment`関数を`myCounter`変数に代入しています。この`myCounter`変数を実行するたびに1, 2, 3と1ずつ増えた値を返しています。

さらに、もう一度`createCounter`関数を実行して、その返り値を`newCounter`変数に代入します。
`newCounter`変数も実行するたびに1ずつ増えていますが、`myCounter`変数とその値を共有しているわけではないことがわかります。
さらに、もう一度`createCounter`関数を実行して、その返り値を``変数に代入します。
``変数も実行するたびに1ずつ増えていますが、`myCounter`変数とその値を共有しているわけではないことがわかります。

{{book.console}}
```js
Expand All @@ -635,7 +635,7 @@ myCounter(); // => 2
const newCounter = createCounter();
newCounter(); // => 1
newCounter(); // => 2
// `myCounter`と`newCounter`は別々の状態持っている
// `myCounter`と`newCounter`は別々の状態を持っている
myCounter(); // => 3
newCounter(); // => 3
```
Expand Down

0 comments on commit 5d9f5a6

Please # to comment.