Need help using an if else statement and a loop together. JavaScript
<p>I'm just learning JavaScript and I'm trying to have an if else statement declare something, but I want to use a loop with it. Basically something like this: </p>

<pre><code>var myNum = 1;
var linebreak = "&lt;br /&gt;";
var d3d = "You're very lucky! ^_^";
var p3p = "&lt;p&gt;Too Bad. Maybe Next Time.&lt;/p&gt;";
for (myNum = 0; myNum &lt; 7; myNum++) {
    if (myNum == 7) {
        document.write(myNum + linebreak + d3d + myNum);
    } else {
        document.write(p3p + "You're not very lucky today...");
    };
}
</code></pre>

<p>It would say You're not very lucky for the first 6 loops, but at the 7th loop it would say you're very lucky. I know something is wrong, because if it was written correctly, then at the end of the loop it would write the if statement. I know you'd usually have the for loop variable set as "i", but I also need the if else statement to be able to know what that is. Does anyone know what I'm doing wrong?</p>
