source: imaps-frontend/node_modules/core-js/modules/es.iterator.find.js

main
Last change on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 736 bytes
Line 
1'use strict';
2var $ = require('../internals/export');
3var iterate = require('../internals/iterate');
4var aCallable = require('../internals/a-callable');
5var anObject = require('../internals/an-object');
6var getIteratorDirect = require('../internals/get-iterator-direct');
7
8// `Iterator.prototype.find` method
9// https://tc39.es/ecma262/#sec-iterator.prototype.find
10$({ target: 'Iterator', proto: true, real: true }, {
11 find: function find(predicate) {
12 anObject(this);
13 aCallable(predicate);
14 var record = getIteratorDirect(this);
15 var counter = 0;
16 return iterate(record, function (value, stop) {
17 if (predicate(value, counter++)) return stop(value);
18 }, { IS_RECORD: true, INTERRUPTED: true }).result;
19 }
20});
Note: See TracBrowser for help on using the repository browser.