check if temp < 10
if ( temp < 10 ) { hexaDeciNum [ i ] = String . fromCharCode ( temp + 48 ) ; i ++ ; } else { hexaDeciNum [ i ] = String . fromCharCode ( temp + 55 ) ; i ++ ; } n = Math . floor ( n / 16 ) ; } let hexCode = " " ; if ( i == 2 ) { hexCode += hexaDeciNum [ 0 ] ; hexCode += hexaDeciNum [ 1 ] ; } else if ( i == 1 ) { hexCode = " " ; hexCode += hexaDeciNum [ 0 ] ; } else if ( i == 0 ) hexCode = " " ;