Skip to content

Commit 3b848a2

Browse files
vsemozhetbytaddaleax
authored andcommitted
doc: fix wrong function arguments in the buffer.md
PR-URL: #9795 Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 9e47b94 commit 3b848a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/api/buffer.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,7 @@ console.log(buf.lastIndexOf('buffer', 4));
12641264
const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'ucs2');
12651265

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

12691269
// Prints: 4
12701270
console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'ucs2'));
@@ -1446,7 +1446,7 @@ const buf = Buffer.from([0, 5]);
14461446
console.log(buf.readInt16BE());
14471447

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

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

0 commit comments

Comments
 (0)