I have a variable called num and i want to pass it into the array element number but i get undefined showing on the page, heres what i mean:
If i put 1 into the document.write( array[1]); then it works fine??
If i put 1 into the document.write( array[1]); then it works fine??
Code:
var num = 1; array[1] = 'Test'; document.write(array[num]);
Comment