Hi everyone I am new to javascript arrays and understand it just a little but need some help.
I have created an empty array name Numbers. I will use Numbers for all of my functions, therefore, I made it a global variable.
Then I created a function named FillArray. The purpose of this function is to get the last number out of the textbox and stick it into a variable called LastNumber.
When I get the "number" from the textbox, I need to convert it to a true number variable. Last but not least I need to use a while loop to fill the array with a bunchof numbers, starting with ) and ending with LastNumber.
This is what I have but I am not confident with it.
var Numbers = new Array();
var LastNumber;
var i;
var LastNumber = Numbers[Numbers.length-1];
function FillArray()
i = 0;
while (i < LastNumber) {
document.frmMain.txtaOutput.value = (Numbers[i]);
i = i + 1;
}
can someone explain to me what I am doing wrong and what I should do?