Массивы и коллекции / Итераторы

functioncounter(low: number, high: number, step: number) {
    let current = low
    while (current <= high) {
        yield current
        current += step
    }
}

for (let c of counter(392)) {
    console.log(c)
}
//printed 3, 5, 7, 9