javascript-tutorial / javascript-tutorial/en.javascript.info
Misleading Explanation About Comma Operator Precedence
还没有人认领这个 Issue。
- 主要语言
- HTML
- 星标
- 25.5k
- 派生
- 4k
- PR 合并指标
- 30 天内没有已合并 PR
描述
Hi there,
I've come across a section in the documentation (https://javascript.info/operators#comma) that explains the precedence of the comma operator.
However, it seems to have an error in its explanation. The example provided suggests that a = 1 + 2, 3 + 4 should result in a being assigned the value 3, whereas in reality, it correctly returns 7.
I believe this discrepancy could lead to confusion among learners, and the explanation might need clarification to reflect the actual behavior of the comma operator. Thank you for your attention to this matter!
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
查看 issue 中链接的逗号运算符部分,并根据 JavaScript 的运算符优先级和求值行为验证示例。澄清说明,使文档中记录的结果和赋值行为明确无歧义,然后确认修订后的文本与该语言的行为一致。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- documentation
- Issue 类型
- 文档
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100