es6.array.find.js 527 B

1234567891011121314
  1. 'use strict';
  2. // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)
  3. var $export = require('./_export');
  4. var $find = require('./_array-methods')(5);
  5. var KEY = 'find';
  6. var forced = true;
  7. // Shouldn't skip holes
  8. if (KEY in []) Array(1)[KEY](function () { forced = false; });
  9. $export($export.P + $export.F * forced, 'Array', {
  10. find: function find(callbackfn /* , that = undefined */) {
  11. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  12. }
  13. });
  14. require('./_add-to-unscopables')(KEY);