iterator-indexed.js 419 B

1234567891011121314
  1. 'use strict';
  2. require('../modules/es.iterator.map');
  3. var call = require('../internals/function-call');
  4. var map = require('../internals/iterators-core').IteratorPrototype.map;
  5. var callback = function (value, counter) {
  6. return [counter, value];
  7. };
  8. // `Iterator.prototype.indexed` method
  9. // https://github.com/tc39/proposal-iterator-helpers
  10. module.exports = function indexed() {
  11. return call(map, this, callback);
  12. };