UNPKG

@thi.ng/transducers

Version:

Collection of ~170 lightweight, composable transducers, reducers, generators, iterators for functional data transformations

12 lines (11 loc) 217 B
import { ensureArray } from "@thi.ng/arrays/ensure-array"; function* reverse(input) { const _input = ensureArray(input); let n = _input.length; while (n-- > 0) { yield _input[n]; } } export { reverse };