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 <[email protected]>
Reviewed-By: Trevor Norris <[email protected]>
Reviewed-By: Roman Reiss <[email protected]>
  • Loading branch information
chinedufn authored and Myles Borins committed Feb 22, 2016
1 parent 6c27c78 commit 8c732ad
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 8c732ad

Please sign in to comment.