Skip to content

Commit 7f1bb80

Browse files
mozkeeleraddaleax
authored andcommitted
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. PR-URL: #8240 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Brian White <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Prince John Wesley <[email protected]>
1 parent e786656 commit 7f1bb80

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/api/buffer.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1644,10 +1644,10 @@ Examples:
16441644
const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
16451645

16461646
// Prints: 1234567890ab
1647-
console.log(buf.readUIntLE(0, 6).toString(16));
1647+
console.log(buf.readUIntBE(0, 6).toString(16));
16481648

16491649
// Prints: ab9078563412
1650-
console.log(buf.readUIntBE(0, 6).toString(16));
1650+
console.log(buf.readUIntLE(0, 6).toString(16));
16511651

16521652
// Throws an exception: RangeError: Index out of range
16531653
console.log(buf.readUIntBE(1, 6).toString(16));

0 commit comments

Comments
 (0)