es.array.includes.js 559 B

123456789101112131415
  1. 'use strict';
  2. var $ = require('../internals/export');
  3. var $includes = require('../internals/array-includes').includes;
  4. var addToUnscopables = require('../internals/add-to-unscopables');
  5. // `Array.prototype.includes` method
  6. // https://tc39.es/ecma262/#sec-array.prototype.includes
  7. $({ target: 'Array', proto: true }, {
  8. includes: function includes(el /* , fromIndex = 0 */) {
  9. return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  10. }
  11. });
  12. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  13. addToUnscopables('includes');