function displayAnswer(choosenAnswer, displayQuestion) {
    var answerGrade = ''
    if (choosenAnswer.textContent === displayQuestion.rightAnswer.textContent) {
        choosenAnswer=''
        answerGrade = 'Correct'
        userScore.lastGame++
        console.log('Score' ,userScore.lastGame)
    } else {
        choosenAnswer = ''
        answerGrade = 'Incorrect'
        var storedCount = localStorage.getItem('game-count')
        storedCount -= 5
        localStorage.setItem('game-count', storedCount)

    }
    
    answerType.textContent = answerGrade
    setTimer = 1
    showAnswerType = setInterval(function() {
        if (setTimer > 0){
            setTimer--
            
        } else {
            clearInterval(showAnswerType)
            answerType.textContent = ''
        }
    }, 1000)
    getQuestions()
    
}
// displaying if the answer was correct or incorrect    
displaying if the answer was correct or incorrect
displaying if the answer was correct or incorrect
function displayAnswer(choosenAnswer, displayQuestion) {
    var answerGrade = ''
    if (choosenAnswer.textContent === displayQuestion.rightAnswer.textContent) {
        choosenAnswer=''
        answerGrade = 'Correct'
        userScore.lastGame++
        console.log('Score' ,userScore.lastGame)
    } else {
        choosenAnswer = ''
        answerGrade = 'Incorrect'
        var storedCount = localStorage.getItem('game-count')
        storedCount -= 5
        localStorage.setItem('game-count', storedCount)
    }
    answerType.textContent = answerGrade
    setTimer = 1
    showAnswerType = setInterval(function() {
        if (setTimer > 0){
            setTimer--
        } else {
            clearInterval(showAnswerType)
            answerType.textContent = ''
        }
    }, 1000)
    getQuestions()
}
function displayAnswer ( choosenAnswer , displayQuestion ) { var answerGrade = '' if ( choosenAnswer . textContent === displayQuestion . rightAnswer . textContent ) { choosenAnswer = '' answerGrade = 'Correct' userScore . lastGame ++ console . log ( 'Score' , userScore . lastGame ) } else { choosenAnswer = '' answerGrade = 'Incorrect' var storedCount = localStorage . getItem ( 'game-count' ) storedCount -= 5 localStorage . setItem ( 'game-count' , storedCount ) } answerType . textContent = answerGrade setTimer = 1 showAnswerType = setInterval ( function ( ) { if ( setTimer > 0 ) { setTimer -- } else { clearInterval ( showAnswerType ) answerType . textContent = '' } } , 1000 ) getQuestions ( ) }
displaying if the answer was correct or incorrect
displaying if the answer was correct or incorrect