I'm using a somewhat unconventional for loop that works well for what I'm doing as paraphrased below (not bothering to show variable declarations):
if (arr && arr.length > 0) {
for (i = arr.length; i--; i) {
element = arr.pop();
//rest of code
}
}
Closure compiler is giving me a warning of: "WARNING - Suspicious code. This code lacks side effects, is there a bug?" Pointing specifically to the last "i" in the for loop parens.
If I remove the i, jslint throws a warning, if I leave it, closure throws a warning. There are three of these loops in total, is there a "closure friendly" way to do this?