Nodejs String Starts With startWithVowel()

Here you can find the source of startWithVowel()

Method Source Code

String.prototype.startWithVowel = function () {
    return this.charAt(0).toLowerCase().isVowel();
};

String.prototype.isVowel = function () {
    var vowels = ['a', 'e', 'i', 'o', 'u'];
    return vowels.indexOf(this.toLowerCase()) != -1;
};

Related

  1. startWith(str)
    String.prototype.startWith = function(str) {
      var reg = new RegExp("^" + str);
      return reg.test(this);
    };
    String.prototype.endWith = function(str) {
      var reg = new RegExp(str + "$");
      return reg.test(this);
    };
    
  2. startWith(str)
    String.prototype.startWith=function(str){     
      var reg=new RegExp("^"+str);     
      return reg.test(this);        
    String.prototype.endWith=function(str){     
      var reg=new RegExp(str+"$");     
      return reg.test(this);        
    
  3. startWith(str)
    String.prototype.startWith=function(str){  
        if(str==null||str==""||this.length==0||str.length>this.length)  
          return false;  
        if(this.substr(0,str.length)==str)  
          return true;  
        else  
          return false;  
        return true;  
    };
    ...
    
  4. startWith(substr)
    String.prototype.startWith = function(substr) {
        return this.indexOf(substr) == 0;
    };
    
  5. startWith(text)
    String.prototype.startWith = function (text) {
        return this.indexOf(text) == 0;
    };
    var msg = "Hello world!";
    console.log(msg.startWith("Hello"));
    
  6. beginsWith( str )
    String.prototype.beginsWith = function( str ) {
        return this.substr( 0, str.length ) == str;
    };
    
  7. beginsWith(s)
    String.prototype.beginsWith = function(s){
        return this.indexOf(s) == 0;
    };
    
  8. beginsWith(s)
    String.prototype.beginsWith= function(s)
        return s===this.substring(0, s.length);
    if (!String.prototype.localeCompare)
        String.prototype.localeCompare = function(other)
            if (this < other)
                return -1;
    ...
    
  9. beginsWith(t)
    String.prototype.beginsWith = function(t) {
        'use strict';
        t = t.toString();
        return (t.toString() === this.substring(0, t.length));
    };
    String.prototype.trim = function() {
        'use strict';
        return this.replace(/^\s+/,'').replace(/\s+$/,'');
    };
    ...