Why is this last line of code necessary?
<p>I understand all of the following code from an example on a book I'm reading. Except the commented line. I'm thinking that without it the loop never ends? I don't understand the logic behind it though. </p>

<pre><code>var drink = "Energy drink";
var lyrics = "";
var cans = "99";

while (cans &gt; 0) {
    lyrics = lyrics + cans + " cans of " + drink + " on the wall &lt;br&gt;";
    lyrics = lyrics + cans + " cans of " + drink + " on the wall &lt;br&gt;";
    lyrics = lyrics + "Take one down, pass it around, &lt;br&gt;";

    if (cans &gt; 1) {
        lyrics = lyrics + (cans-1) + " cans of" + drink + " on the wall  &lt;br&gt;";
    }
    else {
        lyrics = lyrics + "No more cans of" + drink + " on the wall&lt;br&gt;";
    }
    cans = cans - 1;  // &lt;-- This line I don't understand
}

document.write(lyrics);
</code></pre>
