iterator-indexed.js 356 B

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