Skip to content

Commit a2b40ad

Browse files
vsemozhetbytMylesBorins
authored andcommitted
doc: fix wrong function arguments in the buffer.md
PR-URL: #9795 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent e94abae commit a2b40ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/api/buffer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,7 +1266,7 @@ console.log(buf.lastIndexOf('buffer', 4));
12661266
const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'ucs2');
12671267

12681268
// Prints: 6
1269-
console.log(utf16Buffer.lastIndexOf('\u03a3', null, 'ucs2'));
1269+
console.log(utf16Buffer.lastIndexOf('\u03a3', undefined, 'ucs2'));
12701270

12711271
// Prints: 4
12721272
console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'ucs2'));
@@ -1448,7 +1448,7 @@ const buf = Buffer.from([0, 5]);
14481448
console.log(buf.readInt16BE());
14491449

14501450
// Prints: 1280
1451-
console.log(buf.readInt16LE(1));
1451+
console.log(buf.readInt16LE());
14521452

14531453
// Throws an exception: RangeError: Index out of range
14541454
console.log(buf.readInt16LE(1));

0 commit comments

Comments
 (0)