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:
Vse Mozhet Byt authored and Myles Borins committed 2017-03-08 17:10:17 -08:00
1 parent e94abaec1c
commit a2b40ad6a4
1 file changed
+2 -2
+2 -2
View File
@@ -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));