Introduction to while loops


#1

This is my first post and I hope I'm posting correctly - this layout is a little confusing.
Q: Why does this lessons while loop need to be in a function? Why can't var count = 0 be by itself outside the while loop. What purpose does the function(count < 3) serve that the (count) couldn't do on it's own?Thanks!


#2

Hi - @mtf gave a great explanation of this: http://discuss.codecademy.com/t/5-7-why-the-function/3517/2


#3

Than You for the link!


#4

Could you provide the code you've wrote? Because this:

function(count < 3)

is definitely not working.