|
Very new to javascript, question..
I'm not really looking for someone to fix/answer this for me, but maybe give me a hit in the right direction. I need to fix this while loop to run correctly, but has errors in the code. This code is supposed to fill an array with numbers 1 through 100 and then print them.
Here is the code:
<script type="text/javascript">
/* <![CDATA[ */
var count = 0;
var numbers = new Array(100);
while (count < 100) {
numbers[count] = count;
++count;
}
while (count < 100 ) {
document.write(numbers[count]);
++count;
}
/* ]]> */
</script>
What i am most confused about is this part of the code numbers[count] i don't understand what is going on there. Sorry i am very new to this.
Any ideas would be appreciated
thank you.
|