template T param { Iterable < T > } source param { number } index returns { ( T | undefined ) } export function elementAt < T > ( source , index ) { let i = index ; for ( const item of source ) { if ( i === 0 ) { return item ; } i -- ; } return undefined ; }