How would I write a script that uses an Array, the String Object and a loop to cycle through the strings in the array and find a certain string?
I want it to prompt the user to tell what month they were born in, and then tell them what their zodiac sign is.
questionarray = new Array(13);
questionarray[0] = "January"
questionarray[1] = "February"
questionarray[2] = "March"
questionarray[3] = "April"
questionarray[4] = "May"
questionarray[5] = "June"
questionarray[6] = "July"
questionarray[7] = "August"
questionarray[10] = "September"
questionarray[11] = "October"
questionarray[12] = "November"
questionarray[13] = "December"
var searchstring = prompt("What month were you born in?","Enter your birth month"
...?
I want it to prompt the user to tell what month they were born in, and then tell them what their zodiac sign is.
questionarray = new Array(13);
questionarray[0] = "January"
questionarray[1] = "February"
questionarray[2] = "March"
questionarray[3] = "April"
questionarray[4] = "May"
questionarray[5] = "June"
questionarray[6] = "July"
questionarray[7] = "August"
questionarray[10] = "September"
questionarray[11] = "October"
questionarray[12] = "November"
questionarray[13] = "December"
var searchstring = prompt("What month were you born in?","Enter your birth month"
...?