doc: fix buf.length slice example
authorChinedu Francis Nwafili <frankie.nwafili@gmail.com>
Tue, 16 Feb 2016 14:42:29 +0000 (09:42 -0500)
committerMyles Borins <mborins@us.ibm.com>
Wed, 2 Mar 2016 22:01:11 +0000 (14:01 -0800)
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>
doc/api/buffer.markdown

index a7698b9..ac8b564 100644 (file)
@@ -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