Count the number of vowels and consonants
This avoids loops completely and expresses your intent more clearly, I think.

Also, note that you should explicitly define the valid consonants, so that you will properly ignore numbers, punctuation, etc.

function getCount(words) {
  var words      = (typeof words == 'string') ? words : '',
      count      = re =&gt; (words.match(re) || []).length,
      vowels     = count(/[aeiou]/ig),
      consonants = count(/[bcdfghjklmnpqrstvxzwy]/ig);

  return {vowels, consonants};
}