Depending on a certain condition, I want one of two different for loops to execute. So in the example below, I want console.log to return descending numbers if a > b, and ascending numbers if b > a. I was in no way surprised that this didn't work, but it gives you the idea of what I'm after.
for (if (a > b) {(i = 2; i > 0; i--)} else {(i = 0; i < 2; i++)} {
console.log(i);
};
Obviously I could work around this by having if-else select between two complete and separate loops each with their own console.log(i) code block, but in the case I'm dealing with, that will involve duplicating a huge amount of code.
ifandfor