Permalink
Browse files

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 <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com>
  • Loading branch information...
mozkeeler authored and Fishrock123 committed Aug 23, 2016
1 parent e4fcf55 commit a7c21759d943f9e6aa97101a7f7d999715fc024a
Showing with 2 additions and 2 deletions.
  1. +2 −2 doc/api/buffer.md
View
@@ -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));

0 comments on commit a7c2175

Please sign in to comment.