Javascript String startsWithVowel()

Description

Javascript String startsWithVowel()


String.prototype.startsWithVowel = function () {
    //www .  ja v a  2s.c o  m
    var chr = this.substring(0, 1).toUpperCase();
         
    return chr == 'A' |
           chr == 'E' |
           chr == 'I' |
           chr == 'O' |
           chr == 'U';
};



PreviousNext

Related