Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ryanseys
Created April 29, 2015 19:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanseys/8fd511cd60d1f2d13cc9 to your computer and use it in GitHub Desktop.
Save ryanseys/8fd511cd60d1f2d13cc9 to your computer and use it in GitHub Desktop.
var range = Array.apply(null, Array(1000)).map(function (_, i) {return i;});
var str = '';
for (i in range) {
str += String.fromCharCode(i);
}
new Buffer(str).toString('utf8') == str
// returns true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment