I can check that a string includes letter with using of .indexOf():
my_string = 'sdf sdfdsf dfdsdfs';
console.log(my_string.indexOf(' '));
// returns 4
Is exists method to do the same but from end to begin? (example above must returns 11 - the first white space from right to left)