remarks Also see  repeat ,  repeatedly for related functions.
 *
 *  example param input param num export function * cycle < T > ( input , num = Infinity ) { if ( num < 1 ) return ; let cache = [ ] ; for ( let i of input ) { cache . push ( i ) ; yield i ; } if ( cache . length > 0 ) { while ( -- num > 0 ) { yield * cache ; } } }