:point_down: @iterable-iterator/select
Iterable item selection for JavaScript. See docs.
:warning: Depending on your environment, the code may require
regeneratorRuntime
to be defined, for instance by importing regenerator-runtime/runtime.
import {first, last, nth} from '@iterable-iterator/select';
import {range} from '@iterable-iterator/range';
first(range(10)); // 0
last(range(10)); // 9
nth(range(10), 0); // 0
nth(range(10), -1); // 9
nth(range(10), -3); // 7