es6.array.find.js 526 B

1234567891011121314
  1. 'use strict';
  2. // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)
  3. var $export = require('./$.export')
  4. , $find = require('./$.array-methods')(5)
  5. , KEY = 'find'
  6. , 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);