function* range(min, max) { for (let start = min; start <= max; start++) { yield start; } } let values = [...range(1, 10)];