JSFiddle - React, Tailwind, and code Playground

by Dmitri Ganenco

JavaScript

var exercise= [ 
             ['What is the first name of our professor in this course?', 'cecilia'],
              ['What is the last name of our prof in this coursrs?', 'chan'],
              ['Which language is the most popular one in the world?', 'javascript']
]; 
var player_ans;
var correct_num=0;
    for(var i=0; i<exercise.length; i++){
       player_ans= prompt(exercise[i][0]);  
			 debugger;
       if(player_ans.toLowerCase() === exercise[i][1])
         { correct_num++; 
          }
     }
 document.write('The number of question you answered correctly is '+ correct_num);