Please provide enough code to reproduce the problem. Are you
following recommended practice by using 'strict' to ensure there is
no typo in the array name? If so, the error isn't coming from the
code you posted.

Also, note that your loop does not execute as
many times as there are elements in the array, since an array is
zero-based.