From 4175ea33bd3e1592b0aff14ef1434fef73951e06 Mon Sep 17 00:00:00 2001 From: Deokjin Kim Date: Thu, 21 Sep 2023 22:03:23 +0900 Subject: [PATCH] doc: add missed `inspect` with numericSeparator to example In exmple of `util.inspect` with numericSeparator option, calling `util.inspect` is missed. So actual result is different from expected result. PR-URL: https://github.com/nodejs/node/pull/49717 Reviewed-By: LiviaMedeiros Reviewed-By: Moshe Atlow Reviewed-By: Luigi Pinca Reviewed-By: Trivikram Kamat --- doc/api/util.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/api/util.md b/doc/api/util.md index 3b3e12252d9e95..a8deb083473a8c 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -777,8 +777,14 @@ const million = 1_000_000; const bigNumber = 123_456_789n; const bigDecimal = 1_234.123_45; -console.log(thousand, million, bigNumber, bigDecimal); -// 1_000 1_000_000 123_456_789n 1_234.123_45 +console.log(inspect(thousand, { numericSeparator: true })); +// 1_000 +console.log(inspect(million, { numericSeparator: true })); +// 1_000_000 +console.log(inspect(bigNumber, { numericSeparator: true })); +// 123_456_789n +console.log(inspect(bigDecimal, { numericSeparator: true })); +// 1_234.123_45 ``` `util.inspect()` is a synchronous method intended for debugging. Its maximum