Advanced working with function: Function in if
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 35/100
- Issue 类型
- 文档
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript
调研方向
审查“Function in if”示例以及 issue 中引用的解决方案说明。在 JavaScript 运行时中验证所描述的行为,然后更新教程文本,使说明与观察到的结果一致,并明确函数的作用域。
由索引模型根据 Issue 内容生成。
描述
Function in if
let phrase = "Hello";
if (true) {
let user = "John";
function sayHi() {
alert(${phrase}, ${user});
}
}
sayHi();
As mentioned, in the solution:
The result is an error.
The function sayHi is declared inside the if, so it only lives inside it. There is no sayHi outside.
But, this is wrong.
once the function is called, it will give us "Hello John" and the explanation is quite simple.
There, won't be any error.
- 主要语言
- HTML
- 星标
- 25.5k
- 派生
- 4k
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
javascript-tutorial/en.javascript.info 的其他 Issue
-
难度 1/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 84/100
-
难度 1/5 1 小时以内 新手友好度 92/100
-
Keyboard events: keydown filtering example can't block IME-composed input (Korean/Japanese/Chinese) 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
javascript-tutorial/en.javascript.info#3978 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
查看 javascript-tutorial/en.javascript.info 的全部 Issue
相似的 Issue
-
Add: hunch 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
AbdelStark/awesome-typesafe#104 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
-
A11y ♿️
难度 2/5 1-3 小时 新手友好度 72/100
-
automated issue report
难度 2/5 1-3 小时 新手友好度 85/100
-
documentation improve or update documentation priority/low triage
难度 2/5 半天 新手友好度 86/100
warpdotdev/docs#782 · 1 条评论 ·