All Downloads are FREE. Search and download functionalities are using the official Maven repository.

polyfills.StringIncludes.js Maven / Gradle / Ivy

The newest version!
if ( !String.prototype.includes ) {
  String.prototype.includes = function(search, start) {
    'use strict';
    if (typeof start !== 'number') {
      start = 0;
    } 

    if (start + search.length > this.length) {
      return false;
    } else {
      return this.indexOf(search,start) !== -1;
    }
  };
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy