import { IEnumerable } from "../../types" ; import { BasicEnumerable } from "../BasicEnumerable" ; param source returns export const reverse = < TSource > ( source ) : IEnumerable < TSource > => { function * iterator ( ) { const array = [ ... source ] ; for ( let i = array . length - 1 ; i >= 0 ; i -- ) { yield array [ i ] ; } } return new BasicEnumerable ( iterator ) ; } ;