es.array.some.js 693 B

12345678910111213141516
  1. 'use strict';
  2. var $ = require('../internals/export');
  3. var $some = require('../internals/array-iteration').some;
  4. var arrayMethodIsStrict = require('../internals/array-method-is-strict');
  5. var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
  6. var STRICT_METHOD = arrayMethodIsStrict('some');
  7. var USES_TO_LENGTH = arrayMethodUsesToLength('some');
  8. // `Array.prototype.some` method
  9. // https://tc39.github.io/ecma262/#sec-array.prototype.some
  10. $({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {
  11. some: function some(callbackfn /* , thisArg */) {
  12. return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  13. }
  14. });