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: #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 Myles Borins committed Mar 2, 2016
1 parent 59e55ae commit 8817b8b
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 @@ -604,7 +604,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 8817b8b

Please sign in to comment.