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>
This commit is contained in:
parent
069072c4bf
commit
0cb0287f8a
@ -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.
|
use [`buf.slice()`][] to create a new Buffer.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const buf = new Buffer(10);
|
var buf = new Buffer(10);
|
||||||
buf.write('abcdefghj', 0, 'ascii');
|
buf.write('abcdefghj', 0, 'ascii');
|
||||||
console.log(buf.length);
|
console.log(buf.length);
|
||||||
// Prints: 10
|
// Prints: 10
|
||||||
|
Loading…
x
Reference in New Issue
Block a user