Convert s1 [ i ] and s2 [ i ] to int and perform bitwise AND operation , append to " res " string
res = res + String . fromCharCode ( ( s1 [ i ] . charCodeAt ( ) - ' ' . charCodeAt ( ) & s2 [ i ] . charCodeAt ( ) - ' ' . charCodeAt ( ) ) + ' ' . charCodeAt ( ) ) ; } return res ; }