Skip to content

Commit 53b6a61

Browse files
sarathmsjasnell
authored andcommitted
Documentation update about Buffer initialization
fixes #7230 Reviewed-By: James M Snell <jasnell@gmail.com> PR-URL: nodejs/node-v0.x-archive#25591
1 parent b7229de commit 53b6a61

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/api/buffer.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ It can be constructed in a variety of ways.
6464

6565
Allocates a new buffer of `size` octets. Note, `size` must be no more than
6666
[kMaxLength](smalloc.html#smalloc_smalloc_kmaxlength). Otherwise, a `RangeError`
67-
will be thrown here.
67+
will be thrown here. Unlike `ArrayBuffers`, the underlying memory for buffers is not initialized. So the contents of a newly created `Buffer` is unknown. Use `buf.fill(0)`to initialize a buffer to zeroes.
6868

6969
### new Buffer(array)
7070

0 commit comments

Comments
 (0)