Skip to content

Commit

Permalink
doc: note that buf.buffer's contents might differ
Browse files Browse the repository at this point in the history
This bit me in a personal project since I had no reason to read the
`buf.byteOffset` docs, so point readers there explicitly.

PR-URL: #29651
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
strugee authored and MylesBorins committed Dec 17, 2019
1 parent da1e5ae commit 5334f59
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/api/buffer.md
Expand Up @@ -1025,6 +1025,9 @@ console.log(buf.toString('ascii'));
* {ArrayBuffer} The underlying `ArrayBuffer` object based on
which this `Buffer` object is created.

This `ArrayBuffer` is not guaranteed to correspond exactly to the original
`Buffer`. See the notes on `buf.byteOffset` for details.

```js
const arrayBuffer = new ArrayBuffer(16);
const buffer = Buffer.from(arrayBuffer);
Expand Down

0 comments on commit 5334f59

Please sign in to comment.