array-includes
Version:
An ES7/ES2016 spec-compliant `Array.prototype.includes` shim/polyfill/replacement that works as far down as ES3.
15 lines (12 loc) • 345 B
JavaScript
var define = require('define-properties');
var getPolyfill = require('./polyfill');
module.exports = function shimArrayPrototypeIncludes() {
var polyfill = getPolyfill();
define(
Array.prototype,
{ includes: polyfill },
{ includes: function () { return Array.prototype.includes !== polyfill; } }
);
return polyfill;
};
;