Skip to content

iterable-iterator/next

Repository files navigation

Iterator next function for JavaScript. See docs.

⚠️ Depending on your environment, the code may require regeneratorRuntime to be defined, for instance by importing regenerator-runtime/runtime.

import {iter} from '@iterable-iterator/iter';
import {next, StopIteration} from '@iterable-iterator/next';
next(iter('ABC')); // A
next(iter('')); // throws StopIteration
// With default parameter
next(iter(''), 'x'); // x

License Version Tests Dependencies GitHub issues Downloads

Code issues Code maintainability Code coverage (cov) Code technical debt Documentation Package size