From 05e2db28d58470670368eb9c65433143414f3ce7 Mon Sep 17 00:00:00 2001 From: Lakshya Keshwani Date: Wed, 1 Jul 2026 18:11:41 +0530 Subject: [PATCH] Clarify precedence of comma operator in article and add missing "let" keyword in code example --- 1-js/02-first-steps/08-operators/article.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-js/02-first-steps/08-operators/article.md b/1-js/02-first-steps/08-operators/article.md index 0c1663619f..baaf8b0792 100644 --- a/1-js/02-first-steps/08-operators/article.md +++ b/1-js/02-first-steps/08-operators/article.md @@ -459,7 +459,7 @@ alert( a ); // 7 (the result of 3 + 4) Here, the first expression `1 + 2` is evaluated and its result is thrown away. Then, `3 + 4` is evaluated and returned as the result. ```smart header="Comma has a very low precedence" -Please note that the comma operator has very low precedence, lower than `=`, so parentheses are important in the example above. +Please note that the comma operator has the lowest precedence, lower than `=`, so parentheses are important in the example above. Without them: `a = 1 + 2, 3 + 4` evaluates `+` first, summing the numbers into `a = 3, 7`, then the assignment operator `=` assigns `a = 3`, and the rest is ignored. It's like `(a = 1 + 2), 3 + 4`. ``` @@ -472,7 +472,7 @@ For example: ```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++) { ... } ```