next

next :: Iterator iterator => Any value

description

Returns the next value of an Iterator. It's functionnally equivalent to iterator => iterator.next().value.

example

import { next } from 'conductor'

const iterator = new Set([3, 1, 4]).values()
next(numbers) // 3
next(numbers) // 1
next(numbers) // 4
next(numbers) // undefined

Last updated