mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
doc: fix wrong function arguments in the buffer.md
PR-URL: https://github.com/nodejs/node/pull/9795 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
1 parent
e94abaec1c
commit
a2b40ad6a4
1 file changed
+2
-2
+2
-2
@@ -1266,7 +1266,7 @@ console.log(buf.lastIndexOf('buffer', 4));
|
||||
const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'ucs2');
|
||||
|
||||
// Prints: 6
|
||||
console.log(utf16Buffer.lastIndexOf('\u03a3', null, 'ucs2'));
|
||||
console.log(utf16Buffer.lastIndexOf('\u03a3', undefined, 'ucs2'));
|
||||
|
||||
// Prints: 4
|
||||
console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'ucs2'));
|
||||
@@ -1448,7 +1448,7 @@ const buf = Buffer.from([0, 5]);
|
||||
console.log(buf.readInt16BE());
|
||||
|
||||
// Prints: 1280
|
||||
console.log(buf.readInt16LE(1));
|
||||
console.log(buf.readInt16LE());
|
||||
|
||||
// Throws an exception: RangeError: Index out of range
|
||||
console.log(buf.readInt16LE(1));
|
||||
|
||||
Reference in new issue
Block a user