Perform OR operation on each bit
for ( var i = 0 ; i < max_size ; i ++ ) { var curr_bit = 0 ; for ( var j = 0 ; j < n ; j ++ ) curr_bit = curr_bit | ( arr [ j ] [ i ] . charCodeAt ( 0 ) - ' ' . charCodeAt ( 0 ) ) ; res += String . fromCharCode ( curr_bit + ' ' . charCodeAt ( 0 ) ) ; }