Use include method in IE


Here’s a hack for using the includes method also in the horrible Internet Explorer.

if (!String.prototype.includes) {
  String.prototype.includes = function() {
    "use strict";
    return String.prototype.indexOf.apply(this, arguments) !== -1;
  };
}
JavaScript

Leave a Reply

Your email address will not be published. Required fields are marked *