I want to ask the user a series of questions (this is only for college hence the prompt's and not a proper UI), and to cut down on the LOC I added all the questions to an array called !questions"
For some reason the loop is only including every even number in the array.
The code I am using is below
var questions = ['How old is Mark Zuckerberg?',
'How much is he worth?',
'How old is Bill Gates?',
'How much is he worth?',
'How old is Dennis Ritchie?'];
for (var i = 0; i < 6; i++)
{
prompt(questions[i++]);
}
If anyone could help me to get it prompting every question from the array I would very much appreciate this.
itwice in each loop iteration.