Closed
Why can't we run a loop backwards?
Shouldn't to be able to function similar to below?
for(i = 100; i < cars.length; i--)
I had to come up with a workaround to run the loop backward.
This content is closed to future replies and is no longer being maintained or updated.
Links may no longer function. If you have a similar request, please write a new post.
Shouldn't to be able to function similar to below?
for(i = 100; i < cars.length; i--)
I had to come up with a workaround to run the loop backward.
I've never been able to get the loop to run backwards. It is a design limitation I guess. I generally just set the limit to whatever my count is and then use a counter to get whatever index I actually need. The counter has a decrement method that can be used to subtract one from its value. You can set its initial value before the loop and then decrement it after each iteration. This isn't ideal obviously, but does work.
Question Solved
Question Solved
Question Solved
Question
Question
Question
Question
Question
Question
Question Solved
Pega Collaboration Center has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.