Help with JavaScript.

Status
This thread has been locked.

_8bit

amirsaranbih.github.io
Premium
Feedback score
8
Posts
628
Reactions
164
Resources
0
I'm doing this just for practice. Why my code isn't working?

var array = new Array;

var j = 0;

while (array.lenght <= 5) {
var food = prompt("Input food that you want!");
array[j] = food;
j++
}

for (i = 0; i < array.length; i++) {
document.write(array + "</br>");
}
 
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Turtle

turtle#1989
Supreme
Feedback score
17
Posts
751
Reactions
419
Resources
0
I'm doing this just for practice. Why my code isn't working?

var array = new Array;

var j = 0;

while (array.lenght <= 5) {
var food = prompt("Input food that you want!");
array[j] = food;
j++
}

for (i = 0; i < array.length; i++) {
document.write(array + "</br>");
}
you spelt length wrong
 
Status
This thread has been locked.
Top