doc: fix buffer[index] example
authorChinedu Francis Nwafili <frankie.nwafili@gmail.com>
Tue, 16 Feb 2016 02:28:24 +0000 (21:28 -0500)
committerMyles Borins <mborins@us.ibm.com>
Wed, 2 Mar 2016 22:01:11 +0000 (14:01 -0800)
PR-URL: https://github.com/nodejs/node/pull/5253
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Michaƫl Zasso <mic.besace@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
doc/api/buffer.markdown

index 1da5bb8..a7698b9 100644 (file)
@@ -351,7 +351,7 @@ for (var i = 0; i < str.length ; i++) {
   buf[i] = str.charCodeAt(i);
 }
 
-console.log(buf);
+console.log(buf.toString('ascii'));
   // Prints: Node.js
 ```