xxxxxxxxxx
21
function range(start, stop, step=1) {
let rng = [];
if (stop===undefined) [start, stop] = [0, start];
for (let i=start; step>0 ? i<stop : i>stop; i+=step) rng.push(i);
return rng;
}
function setup() {
let list = ["one", "two", "three"]
for (const item of list){
print(item)
}
for (const i of range(list.length)){
print(i, list[i])
}
}