Skip to content

Commit

Permalink
doc: fix buf.length slice example
Browse files Browse the repository at this point in the history
Previously tried to reassign a const.

PR-URL: nodejs#5259
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
  • Loading branch information
chinedufn authored and silverwind committed Feb 18, 2016
1 parent 069072c commit 0cb0287
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/api/buffer.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0cb0287

Please sign in to comment.