Skip to content

Commit 4175ea3

Browse files
deokjinkimruyadorno
authored andcommitted
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: #49717 Reviewed-By: LiviaMedeiros <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent 843df1a commit 4175ea3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

doc/api/util.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -777,8 +777,14 @@ const million = 1_000_000;
777777
const bigNumber = 123_456_789n;
778778
const bigDecimal = 1_234.123_45;
779779

780-
console.log(thousand, million, bigNumber, bigDecimal);
781-
// 1_000 1_000_000 123_456_789n 1_234.123_45
780+
console.log(inspect(thousand, { numericSeparator: true }));
781+
// 1_000
782+
console.log(inspect(million, { numericSeparator: true }));
783+
// 1_000_000
784+
console.log(inspect(bigNumber, { numericSeparator: true }));
785+
// 123_456_789n
786+
console.log(inspect(bigDecimal, { numericSeparator: true }));
787+
// 1_234.123_45
782788
```
783789

784790
`util.inspect()` is a synchronous method intended for debugging. Its maximum

0 commit comments

Comments
 (0)