Store the index of the character
var index = 0 ; if ( s [ i ] === s [ i ] . toLowerCase ( ) ) index = s [ i ] . charCodeAt ( 0 ) - " " . charCodeAt ( 0 ) ; else index = s [ i ] . charCodeAt ( 0 ) - " " . charCodeAt ( 0 ) ;