I'm creating a typing test in Javascript. When the user presses the keyboard button, the typing test begins if zero keys have been pressed previously. If textEnteredLength (keys pressed) is === 0 and !timerRunning is equal to not false. Why does this function run? 0 === not false, is not a true statement, right?
var timerRunning = false;
function start() {
let textEnterdLength = testArea.value.length;
if (textEnterdLength === 0 && !timerRunning){
timerRunning = true;
interval = setInterval(runTimer, 10);
}
Aucun commentaire:
Enregistrer un commentaire