PV
Size: a a a
PV
t
PV
t
L
function* range(current, end, step = 1) {
if(current && !end) {
end = current;
current = 0;
}
const isStepPositive = current < end;
if(!isStepPositive) {
step = -step
}
for(; (isStepPositive ? current < end : current > end); current = current + step)
yield current
} вот, переделал на генератор. Куда проще выглядитS
function* range(current, end, step = 1) {
if(current && !end) {
end = current;
current = 0;
}
const isStepPositive = current < end;
if(!isStepPositive) {
step = -step
}
for(; (isStepPositive ? current < end : current > end); current = current + step)
yield current
} вот, переделал на генератор. Куда проще выглядит
t
function* range(current, end, step = 1) {
if(current && !end) {
end = current;
current = 0;
}
const isStepPositive = current < end;
if(!isStepPositive) {
step = -step
}
for(; (isStepPositive ? current < end : current > end); current = current + step)
yield current
} вот, переделал на генератор. Куда проще выглядитt
function* range(current, end, step = 1) {
if(current && !end) {
end = current;
current = 0;
}
const isStepPositive = current < end;
if(!isStepPositive) {
step = -step
}
for(; (isStepPositive ? current < end : current > end); current = current + step)
yield current
} вот, переделал на генератор. Куда проще выглядитt
function* range(current, end, step = 1) {
if(current && !end) {
end = current;
current = 0;
}
const isStepPositive = current < end;
if(!isStepPositive) {
step = -step
}
for(; (isStepPositive ? current < end : current > end); current = current + step)
yield current
} вот, переделал на генератор. Куда проще выглядитL
В
В
function* range(current, end, step = 1) {
if(current && !end) {
end = current;
current = 0;
}
const isStepPositive = current < end;
if(!isStepPositive) {
step = -step
}
for(; (isStepPositive ? current < end : current > end); current = current + step)
yield current
} вот, переделал на генератор. Куда проще выглядитМГ