const pages = [];
for (let i = 1; i <= Math.ceil(reposCount / elementsCount); i += 1) {
pages.push(i);
}
[...Array(Math.ceil(reposCount / elementsCount)).keys()].forEach(x => pages.push(x))
const pages = Array.from({ length: Math.ceil(reposCount / elementsCount) }, (_, i) => i + 1);
const pages = new Array(Math.ceil(reposCount / elementsCount)).fill(null).map((_, i) => i + 1);
function* range(from, to) {
for (let i = from; i <= to; i++) {
yield i;
}
}
const pages = [...range(1, Math.ceil(reposCount / elementsCount))];