+ 1
javascript array
how can i assign the js array from user input ? var arr= new array(2) arr[1]= window.prompt("enter number") it doesn't work
3 Answers
+ 9
@Pegasus: You must use "var" NOT "int", right? :)
+ 3
Initialize the array with length x.
Then,
for (int i=0;i<x;i++){
array[i]=prompt("Enter value")
}