Skip to content

Commit 951dbc0

Browse files
authored
doc: remove unneeded new in Buffer example
PR-URL: #42682 Reviewed-By: Mestery <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Akhil Marsonya <[email protected]>
1 parent 65e8380 commit 951dbc0

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
@@ -1530,7 +1530,7 @@ a `Buffer` is that in this case one needs to specify the `byteOffset` correctly:
15301530
import { Buffer } from 'buffer';
15311531

15321532
// Create a buffer smaller than `Buffer.poolSize`.
1533-
const nodeBuffer = new Buffer.from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
1533+
const nodeBuffer = Buffer.from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
15341534

15351535
// When casting the Node.js Buffer to an Int8Array, use the byteOffset
15361536
// to refer only to the part of `nodeBuffer.buffer` that contains the memory
@@ -1542,7 +1542,7 @@ new Int8Array(nodeBuffer.buffer, nodeBuffer.byteOffset, nodeBuffer.length);
15421542
const { Buffer } = require('buffer');
15431543

15441544
// Create a buffer smaller than `Buffer.poolSize`.
1545-
const nodeBuffer = new Buffer.from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
1545+
const nodeBuffer = Buffer.from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
15461546

15471547
// When casting the Node.js Buffer to an Int8Array, use the byteOffset
15481548
// to refer only to the part of `nodeBuffer.buffer` that contains the memory

0 commit comments

Comments
 (0)