From 6050bbe60a9c9f0b95bda8fe5718209b4eb0028a Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Sat, 26 Nov 2016 23:05:08 +0200 Subject: [PATCH] doc: fix wrong function arguments in the buffer.md PR-URL: https://github.com/nodejs/node/pull/9795 Reviewed-By: Sam Roberts Reviewed-By: Roman Reiss Reviewed-By: Anna Henningsen --- doc/api/buffer.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/buffer.md b/doc/api/buffer.md index a2c446dba93d1a..bd16b381602b3f 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -1264,7 +1264,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')); @@ -1446,7 +1446,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));