If character is an alphabet
if ( ( str [ i ] . charCodeAt ( 0 ) >= " " . charCodeAt ( 0 ) && str [ i ] . charCodeAt ( 0 ) <= " " . charCodeAt ( 0 ) ) || ( str [ i ] . charCodeAt ( 0 ) >= " " . charCodeAt ( 0 ) && str [ i ] . charCodeAt ( 0 ) <= " " . charCodeAt ( 0 ) ) ) alpha . push ( str [ i ] ) ; }