declaration of your array variable would be outsid...
# suitescript
j
declaration of your array variable would be outside the loop as well