Why isn't the set timeout function activating the win statement?
<p>The task I want my program to complete successfully is for it to intake a value from the command prompt variable <code>ask</code> and check if it was correct. But if the player doesn't answer in time, the set timeout function would execute therefore subtracting a life. </p>

<p>My problem is when I enter the prompt <code>ask</code> the timeout function isn't setting off at all.</p>

<p>Also, I have the whole thing in a for-loop so when the player does get the answer correct, it runs again and subtracts the time so there is less and less time to solve the problem. My code is below.</p>

<pre><code>var win = null;
var product = "123456";
time = 3000;

for(var i = 0; i &lt; 1; i++) {
    confirm("Round will start after you close this confirm window.");

    setTimeout(function() {
        var ask = prompt("Enter code below: (QUICK) " + product + " (Answer for development purposes)"); 

        if(ask === product){
            win = true;
            console.log("Hurrah!");
        } else {
            win = false;
            console.log("Arr. Well get em next time.");
        }
    }, 1);

    //Why is this not activating???
    setTimeout(function() { 
        if (win === null || false) {
            lives = lives - 1;
            win = false;

            console.log("Oh No! You ran out of time. Lives left: " + lives);
        }
    }, time);  

    time = time - 100;    
}
</code></pre>