I want to declare an array in Jquery to avoid "undefined"
I declare like this:
var array = [""];
but It applied for first loop only.
In the second loop array[1], it returns undefined.
How can I declare an array to avoid undefined.
Thank for your help.
for (var i=0; i<array.length; i++) {}it will not go to position [1]. If you need a fixed length array have a look at stackoverflow.com/questions/4852017/…