function* enumerate(iterable) {
  let i = 0;

  // eslint-disable-next-line
  for (const x of iterable) {
    yield [x, i];
    i += 1;
  }
}
enumerate an iterable
Inspired by: http://stackoverflow.com/a/10179849

@param iterable