Traversing the String
for ( let i = 0 ; i < num . length ; i ++ ) if ( i % 2 == 0 ) proOdd = proOdd * ( num [ i ] . charCodeAt ( ) - ' ' . charCodeAt ( ) ) ; else proEven = proEven * ( num [ i ] . charCodeAt ( ) - ' ' . charCodeAt ( ) ) ; if ( proOdd == proEven ) document . write ( " " ) ; else document . write ( " " ) ; }