Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion zh-CN/README-zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -4148,7 +4148,7 @@ getInfo();

#### 答案:D

通过 `const` 关键字声明的变量在被初始化之前不可被引用:这被称之为 _暂时性死区_。在函数 `getInfo` 中,变量 `randomValue` 声明在`getInfo` 的作用域的此法环境中。在想要对 `typeof randomValue` 进行 log 之前,变量 `randomValue` 仍未被初始化:错误`ReferenceError` 被抛出!JS 引擎并不会根据作用域链网上寻找该变量,因为我们已经在 `getInfo` 函数中声明了 `randomValue` 变量。
通过 `const` 关键字声明的变量在被初始化之前不可被引用:这被称之为 _暂时性死区_。在函数 `getInfo` 中,变量 `randomValue` 的作用域是 `getInfo` 函数的函数作用域。在想要对 `typeof randomValue` 进行 log 之前,变量 `randomValue` 仍未被初始化:错误`ReferenceError` 被抛出!JS 引擎并不会根据作用域链往上寻找该变量,因为我们已经在 `getInfo` 函数中声明了 `randomValue` 变量。

</p>
</details>
Expand Down