How can I write a for loop with multiple conditions?
Intended Javascript:
for(k=1; k < 120 && myThing.someValue > 1234; k++){
myThing
Since a for
loop is equivalent to a while
loop plus a couple of statements, and CoffeeScript offers only one kind of for
loop, use a while
loop. If you’re trying to get specific JavaScript output, you should probably not be using CoffeeScript.
Of course, there is always
`for(k=1; k < 120 && myThing.someValue > 1234; k++) {`
do myThing.action
`}`
Avoid.