Jump to content

Increment++


Drycodez

Recommended Posts

Right. JavaScript does not support static variables inside functions. When your first function runs, i resets to 0 every time. For this not to happen, one solution is to use a global variable, as your second function does.

Link to comment
Share on other sites

Let me help...rite. js no haz static vars in funcs. wen yer 1st func runs, i reset 2 0 every time. 4 dis not 2 hpn, 1 sol is 2 use a global var, as yer 2nd func does.Hopefully that's easier to understand for you, Samuel.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...