Hi, I'm trying to build something extremely simple, a global counter variable for storing event logs. Basically everytime somebody hits the submit button, the counter increases by 1 and the corresponding value is inserted into a database. Something like this? let globalcounter = 0;
onClick -> globalcounter = globalcounter + 1; The only problem is that the globalcounter in this case keeps resetting to 0 everytime the submit button is pressed. How do I solve this problem?