Skip to content

Clarify precedence of comma operator in article and add missing "let"…#3974

Open
Lk-ux wants to merge 1 commit into
javascript-tutorial:masterfrom
Lk-ux:patch-2
Open

Clarify precedence of comma operator in article and add missing "let"…#3974
Lk-ux wants to merge 1 commit into
javascript-tutorial:masterfrom
Lk-ux:patch-2

Conversation

@Lk-ux

@Lk-ux Lk-ux commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

… keyword in code example

@javascript-translate-bot javascript-translate-bot added review needed Review needed, please approve or request changes labels Jul 1, 2026
@javascript-translate-bot
javascript-translate-bot requested review from a team July 1, 2026 12:43
@smith558

Copy link
Copy Markdown
Member

@codex review

@smith558 smith558 self-assigned this Jul 25, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 05e2db28d5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

```js
// three operations in one line
for (*!*a = 1, b = 3, c = a * b*/!*; a < 10; a++) {
for (*!*let a = 1, b = 3, c = a * b*/!*; a < 10; a++) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the loop initializer as a comma expression

Adding let changes this initializer from a comma expression into a lexical declaration containing three declarators, where the commas are separators rather than instances of the comma operator. Consequently, the section's final example no longer demonstrates the operator it claims frameworks use; declare the variables separately and retain the assignment expression in the initializer, or otherwise use an actual comma expression here.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review needed Review needed, please approve or request changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants