polyfill.js 379 B

1234567891011
  1. define(function() {
  2. // IE: WH-2284
  3. if (!String.prototype.endsWith) {
  4. String.prototype.endsWith = function (search, this_len) {
  5. if (this_len === undefined || this_len > this.length) {
  6. this_len = this.length;
  7. }
  8. return this.substring(this_len - search.length, this_len) === search;
  9. };
  10. }
  11. });