Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript VAR only works outside function? Reply To: VAR only works outside function?

#148972
TheDoc
Member

Super simple! It’s because every time you’re running the greenFunk function you’re resetting var a to be 0 so your if statement will never be true.