Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Java laugh simple

Name: Anonymous 2013-02-16 10:42

My head is spinning at the fact I cant do such a simple problem, a month off really didnt do me any good.

How do I check if a string which contains a phrase or a word has all its vowels but in alphabetical order.
eg. aerious

Name: Anonymous 2013-02-16 14:01


  function java_laugh_simple(word) {
    var prev = -1;
    return ['a', 'e', 'i', 'o', 'u'].every(function(vowel) {
      var index = word.indexOf(vowel);
      return (index > prev) ? !!(1 + (prev = index)) : false;
    });
  }

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List