Print For Loop Results using Modulus Operator in Console
How do I print the results of var i in a for loop using console.PrintIn();?
I'm writing the for loops to target specific button widgets that are 1 to 9 (this.getField("button." + 1, 3, 5, 7, 9) to hide those specific widgets. I'm trying to figure out why this isn't working by writing a for loop that will return odd numbers using the modulus operator.
I'm getting an error that console.printIn() is not a function. I've tried several variations of the below code...
for(var i = 1; i < 10; i++) {
if((i % 2) != 0) {
console.printIn(i);
}
}
Here's the actual code I'm writing. I'm not getting any JS errors, but the addition of this snippet seems to crash Acrobat everytime whereas it did not before the new for loop was introduced:
for(var i = 1; i < 10; i++) {
if(i % 2 != 0) {
this.getField("enclosure.2." + i).display = display.hidden;
this.getField("enclosure.4." + i).display = display.hidden;
this.getField("enclosure.6." + i).display = display.hidden;
}
}