Browse Source

doc: fix buf.length slice example

Previously tried to reassign a const.

PR-URL: https://github.com/nodejs/node/pull/5259
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
v5.x
Chinedu Francis Nwafili 9 years ago
committed by Rod Vagg
parent
commit
c48290d9b7
  1. 2
      doc/api/buffer.markdown

2
doc/api/buffer.markdown

@ -619,7 +619,7 @@ modify the length of a Buffer should therefore treat `length` as read-only and
use [`buf.slice()`][] to create a new Buffer.
```js
const buf = new Buffer(10);
var buf = new Buffer(10);
buf.write('abcdefghj', 0, 'ascii');
console.log(buf.length);
// Prints: 10

Loading…
Cancel
Save