You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[zh-CN] Misleading comments in string concatenation examples (Incorrect commas) #1940
Description:
Describe the bug
In the Chinese translation of the JavaScript basics lesson (String Formatting section), the comments in all three code examples are identical (//你好,世界!), which is highly misleading because the actual output of the first two lines does not contain a comma.
To Reproduce
Steps to reproduce the behavior:
Go to the lesson file: [File Path / URL]
Look at the code snippet under "字符串格式化":
let myString1 = "Hello";
let myString2 = "World";
Line 1: myString1 + myString2 + "!" outputs HelloWorld!. The comment says 你好,世界! (contains a comma, incorrect).
Line 2: myString1 + " " + myString2 + "!" outputs Hello World! (only a space). The comment says 你好,世界! (contains a comma, incorrect).
Line 3: myString1 + ", " + myString2 + "!" outputs Hello, World!. The comment 你好,世界! is a loose translation but acceptable here.
Expected behavior
The comments should accurately reflect the actual output of the code. Because the first two lines do not add a comma, beginners will be confused when the output doesn't match the "中文意译" in the comment.
Suggested fix
Update the comments to strictly match the code output. For example:
Additional context
This is a common issue in translated documentation. The translator translated the result into natural Chinese, but forgot to update the comment for the first two examples where the code explicitly concatenates without a comma. This causes a mismatch between the JS logic and the expected output for beginners.
Activity
taneightseven commentedon Oct 14, 2026
URL of the affected file:https://github.com/microsoft/Web-Dev-For-Beginners/blob/main/translations/zh-CN/2-js-basics/1-data-types/README.md