I have a for loop and inside I'd like to get a sequence like 1,-1,1,-1... (The loop does other things also so I don't want to alter the loop itself)
For now I have a solution like below, but there must be some more elegant way to do this I think :)
let plusMinus = [-1, 1]
for (let i = 0; i < 10; i++) {
console.log(plusMinus[i % 2])
}