Binary to ascii mapping in JavaScript This morning I've seen this on Twitter: 
http://mynewtechworld.tumblr.com/post/135545896048

I case that somebody can't see the image:


  I
  01101100
  01101111
  01110110
  01100101
  you.


Just for fun I wrote this binary to ascii-converter in JavaScript: 

var chars = [
  'I ',
  0b01101100,
  0b01101111,
  0b01110110,
  0b01100101,
  ' you.'
];

var result = chars.reduce(function(previous, current) {

  if (!isNaN(current)) {
    current = String.fromCharCode(current.toString());
  }

  return previous + current;
}, '');


My complete implementation on CodePen
I suggest splitting:


Converting binary to ascii
Concatenating




After defining binaryToNumber and add. the final code will look much simpler:

var result = chars.map(binaryToNumber).reduce(add)