I'm new to Javascript and working on building a quiz app. All of the quiz questions and answers are stored in an array in an object named 'quiz'. I'm trying to use a loop to get the app to cycle through the questions on click of a button. However, the loop I'm using seems to be freezing my page. Any pointers for where I'm going wrong?
//sample object
quiz = {
"questions": [
{
"question":"Question 1",
"a":"Answer a1",
"b":"Answer b1",
"c":"Answer c1",
"d":"Answer d1",
},
{
"question":"Question 2",
"a":"Answer a2",
"b":"Answer b2",
"c":"Answer c2",
"d":"Answer d2",
}
]
}
//load next question on click
$("#next").click(function(){
for (i=1; i<quiz.questions.length; i.next) {
$("#question").text(quiz.questions[i].question);
};
});
i.next====>i++