assets/javascript/app.js
// function to add time counter and what to do if no answer is selected
function to add time counter and what to do if no answer is selected
function to add time counter and what to do if no answer is selected
function timer() {
    interval = setInterval(function() {
      counter--;
      $('#time').text(counter);
      if (counter === 0) {
        incorrect++;
        $('#trivia').html(
          `<h4> You chose the incorrect answer!</p> <p> The correct answer is ${
            questions[questionCounter].correct
          }</h4><img class = "img-thumbnail" src = ${
            questions[questionCounter].url
          }>`
        );
        dispalyNextQuestion();
      }
    }, 1000);
  }
function timer ( ) { interval = setInterval ( function ( ) { counter -- ; $ ( '#time' ) . text ( counter ) ; if ( counter === 0 ) { incorrect ++ ; $ ( '#trivia' ) . html ( ` ${ questions [ questionCounter ] . correct } ${ questions [ questionCounter ] . url } ` ) ; dispalyNextQuestion ( ) ; } } , 1000 ) ; }
function to add time counter and what to do if no answer is selected
function to add time counter and what to do if no answer is selected