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));