Javascript-форум (https://javascript.ru/forum/)
-   Общие вопросы Javascript (https://javascript.ru/forum/misc/)
-   -   Помогите разобраться (!gameOver) (https://javascript.ru/forum/misc/62499-pomogite-razobratsya-gameover.html)

vodooON 13.04.2016 17:48

Помогите разобраться (!gameOver)
 
Немогу понять зачем в первом if'e ставить знак ! то есть (!gameOver) :help:

var p1Button = document.getElementsByTagName("button")[0];
var p1Score = 0;
vvar p1Display = document.getElementById("p1Display");
var gameOver = false;
var winningScore = 5;

p1Button.addEventListener("click", function(){
p1Score++
if(!gameOver){
p1Display.textContent = p1Score;
if (p1Score === winningScore) {
gameOver = true;
}
}

})

заранее благодарен.:)


Часовой пояс GMT +3, время: 13:20.