From c82a3d6f05cd84d96b2c42a6c8ec831de667ff78 Mon Sep 17 00:00:00 2001 From: rosald <35028438+rosald@users.noreply.github.com> Date: Thu, 1 Jan 2026 12:47:57 +0800 Subject: [PATCH] Update how-to-use-the-nodejs-repl.md Updated technical documentation to accurately describe console.log() as a function call expression (not merely a statement) and 5 === '5' as a comparison expression. Both are expressions in JavaScript, but differ in that console.log() produces side effects with an undefined return value, while comparison expressions directly return boolean results. Signed-off-by: rosald <35028438+rosald@users.noreply.github.com> --- .../pages/en/learn/command-line/how-to-use-the-nodejs-repl.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/site/pages/en/learn/command-line/how-to-use-the-nodejs-repl.md b/apps/site/pages/en/learn/command-line/how-to-use-the-nodejs-repl.md index f29a61d91db63..240761ad50b96 100644 --- a/apps/site/pages/en/learn/command-line/how-to-use-the-nodejs-repl.md +++ b/apps/site/pages/en/learn/command-line/how-to-use-the-nodejs-repl.md @@ -59,7 +59,7 @@ false > ``` -Note the difference in the outputs of the above two lines. The Node REPL printed `undefined` after executing `console.log()`, while on the other hand, it just printed the result of `5 === '5'`. You need to keep in mind that the former is just a statement in JavaScript, and the latter is an expression. +Please note the difference in the outputs of the above two lines. The Node REPL printed undefined after executing console.log(), while it simply printed the result of 5 === '5'. Keep in mind that the former is a function call expression in JavaScript, and the latter is a comparison expression. Both are expressions, but console.log() primarily produces side effects (outputting content) and returns undefined, whereas the comparison expression directly returns a boolean result. In some cases, the code you want to test might need multiple lines. For example, say you want to define a function that generates a random number, in the REPL session type in the following line and press enter: