doc: fix typo

PR-URL: https://github.com/nodejs/node/pull/56125
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
This commit is contained in:
Alex Yang
2024-12-03 18:35:30 -08:00
committed by GitHub
parent fe12b01bf4
commit 7bedcfd4a2

View File

@@ -80,11 +80,11 @@ When a `Buffer` is created using a resizable `ArrayBuffer`, the `Buffer` length
```js
const ab = new ArrayBuffer(10, { maxByteLength: 20 });
const buffer = Buffer.from(ab);
console.log(buffer.byteLength); 10
console.log(buffer.byteLength); // 10
ab.resize(15);
console.log(buffer.byteLength); 15
console.log(buffer.byteLength); // 15
ab.resize(5);
console.log(buffer.byteLength); 5
console.log(buffer.byteLength); // 5
```
Contributed by James Snell in [#55377](https://github.com/nodejs/node/pull/55377)