src/BitArray/bitArray.js
function(n){
  if(typeof n === 'number'){
    return n;
  }
  if(typeof n !== 'string'){
    n = JSON.stringify(n)
  }
  var res = 0;
  n.split("").map(function(bit){
    res += bit.charCodeAt(0);
  });
  return res;
}
function(n){
  if(typeof n === 'number'){
    return n;
  }
  if(typeof n !== 'string'){
    n = JSON.stringify(n)
  }
  var res = 0;
  n.split("").map(function(bit){
    res += bit.charCodeAt(0);
  });
  return res;
}
function ( n ) { if ( typeof n === 'number' ) { return n ; } if ( typeof n !== 'string' ) { n = JSON . stringify ( n ) } var res = 0 ; n . split ( "" ) . map ( function ( bit ) { res += bit . charCodeAt ( 0 ) ; } ) ; return res ; }
Transforms input into a number.
@param {*} input to become a number
@return {number} number version of input
Transforms input into a number .