From 7b2d7aec1be5cea376f0f444d0e1c0c314579a6c Mon Sep 17 00:00:00 2001 From: David Keeler Date: Tue, 23 Aug 2016 10:50:28 -0700 Subject: [PATCH] doc: fix buf.readUIntBE, buf.readUIntLE examples The documentation describing the output from the examples for buf.readUIntBE and buf.readUIntLE were switched in terms of what the code would actually output. This patch addresses this by switching the two lines of example code to be in the same order as the functions are listed earlier in the documentation. --- 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 9533324c15f441..034c24ab3c6158 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -1644,10 +1644,10 @@ Examples: const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); // Prints: 1234567890ab -console.log(buf.readUIntLE(0, 6).toString(16)); +console.log(buf.readUIntBE(0, 6).toString(16)); // Prints: ab9078563412 -console.log(buf.readUIntBE(0, 6).toString(16)); +console.log(buf.readUIntLE(0, 6).toString(16)); // Throws an exception: RangeError: Index out of range console.log(buf.readUIntBE(1, 6).toString(16));