Nodejs String Include includes(string, index)

Here you can find the source of includes(string, index)

Method Source Code

String.prototype.includes = function (string, index) {
   if (typeof string === 'object' && string instanceof RegExp) 
      throw new TypeError("First argument to String.prototype.includes must not be a regular expression");
   return this.indexOf(string, index) !== -1;
};

Related

  1. include(x)
    String.prototype.include = function(x){
      return this.indexOf(x) > -1
    
  2. includeString(search, start, caseSensitive, eachOther)
    String.prototype.includeString = function (search, start, caseSensitive, eachOther) {
      'use strict';
      caseSensitive = caseSensitive === void 0 ? false : !!caseSensitive;
      eachOther = eachOther === void 0 ? false : !!eachOther;
      if (caseSensitive) {
        return this.includes(search, start);
      if (typeof start !== 'number') {
        start = 0;
    ...
    
  3. includes( other )
    String.prototype.includes = function( other ){
      return !!other && this.indexOf( other) != -1
    function str_includes( that, other ){
      return !!other && that.indexOf( other) != -1
    
  4. includes()
    String.prototype.includes = function () {
        'use strict';
        return String.prototype.indexOf.apply(this, arguments) !== -1;
    };
    
  5. includes(matcher)
    String.prototype.includes = function(matcher) {
      var includes = false;
      if( this.indexOf( matcher ) > 0 ) {
        includes = true;
      return includes;
    
  6. includes(substring)
    String.prototype.includes = function(substring){
      return this.indexOf(substring) > -1 ? true : false;
    
  7. includes(val, from)
    String.prototype.includes = function(val, from) {
        return this.indexOf(val, from) !== -1;