js/app.js
/**
 * @description Closes the final modal and resets the game if user clicks the button 'Play Again'
 * @param event
 */
@description Closes the final modal and resets the game if user clicks the button 'Play Again'
@param event
@description Closes the final modal and resets the game if user clicks the button ' Play Again ' @param event
function closeThePopup(event) {
    const targetElement = event.target;
    document.querySelector('.overlay').classList.remove('target');
    if (targetElement.nodeName.toLowerCase() == 'span') {
        if (targetElement.parentElement.classList.contains('play-again')) {
            restartGame();
        }
    } else if (targetElement.nodeName.toLowerCase() == 'button') {
        if (targetElement.classList.contains('play-again')) {
            restartGame();
        }
    }
}
function closeThePopup ( event ) { const targetElement = event . target ; document . querySelector ( '.overlay' ) . classList . remove ( 'target' ) ; if ( targetElement . nodeName . toLowerCase ( ) == 'span' ) { if ( targetElement . parentElement . classList . contains ( 'play-again' ) ) { restartGame ( ) ; } } else if ( targetElement . nodeName . toLowerCase ( ) == 'button' ) { if ( targetElement . classList . contains ( 'play-again' ) ) { restartGame ( ) ; } } }
@description Closes the final modal and resets the game if user clicks the button 'Play Again'
 @param event
@description Closes the final modal and resets the game if user clicks the button ' Play Again ' @param event