Skip to content

Commit 1878a25

Browse files
mischnicjuanarbol
authored andcommitted
doc: remove unneeded new in Buffer example
PR-URL: #42682 Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
1 parent c810ff2 commit 1878a25

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

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

15171517
// When casting the Node.js Buffer to an Int8Array, use the byteOffset
15181518
// to refer only to the part of `nodeBuffer.buffer` that contains the memory
@@ -1524,7 +1524,7 @@ new Int8Array(nodeBuffer.buffer, nodeBuffer.byteOffset, nodeBuffer.length);
15241524
const { Buffer } = require('buffer');
15251525

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

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

0 commit comments

Comments
 (0)