compare characters by ASCII value
if ( str1 [ i ] . charCodeAt ( ) >= ' ' . charCodeAt ( ) && str1 [ i ] . charCodeAt ( ) <= ' ' . charCodeAt ( ) ) { if ( str1 [ i ] . charCodeAt ( ) - 32 != str2 [ i ] . charCodeAt ( ) ) return false ; } else if ( str1 [ i ] . charCodeAt ( ) >= ' ' . charCodeAt ( ) && str1 [ i ] . charCodeAt ( ) <= ' ' . charCodeAt ( ) ) { if ( str1 [ i ] . charCodeAt ( ) + 32 != str2 [ i ] . charCodeAt ( ) ) return false ; }