Skip to content

Commit 3f1a237

Browse files
Jungku Leetargos
Jungku Lee
authored andcommitted
doc: add print results for examples in StringDecoder
PR-URL: #49326 Refs: #49143 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 45caad8 commit 3f1a237

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doc/api/string_decoder.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ const { StringDecoder } = require('node:string_decoder');
2121
const decoder = new StringDecoder('utf8');
2222

2323
const cent = Buffer.from([0xC2, 0xA2]);
24-
console.log(decoder.write(cent));
24+
console.log(decoder.write(cent)); // Prints: ¢
2525

2626
const euro = Buffer.from([0xE2, 0x82, 0xAC]);
27-
console.log(decoder.write(euro));
27+
console.log(decoder.write(euro)); // Prints: €
2828
```
2929

3030
When a `Buffer` instance is written to the `StringDecoder` instance, an
@@ -41,7 +41,7 @@ const decoder = new StringDecoder('utf8');
4141

4242
decoder.write(Buffer.from([0xE2]));
4343
decoder.write(Buffer.from([0x82]));
44-
console.log(decoder.end(Buffer.from([0xAC])));
44+
console.log(decoder.end(Buffer.from([0xAC]))); // Prints: €
4545
```
4646

4747
## Class: `StringDecoder`

0 commit comments

Comments
 (0)