penders - 4:15 pm on Dec 25, 2011 (gmt 0)
...but why then doesn't it also 'lose' the decremented value of num?
Because num is declared in the global scope. It is declared (with the var keyword) outside of any function and therefore exists everywhere (ie. it is 'global').