+ 1
Variable
I was wondering if it was possible to have variable keep values when we're not using them in JavaScript. For example, if I want to make a survey: I make a variable called surveyAnswers and I want to add one to it each time someone runs the program. The problem is, I have to give a start value to my variable (0) , but then it restarts at 0 every time the program is run. (I'm just a beginner in code, so it would really help if anyone had an idea on this)
2 Answers
+ 4
You need to store it somehow, you can use for example session storage, local storage, cookies or database. The choice is yours âșïž
+ 1
Okay but... How can I use those?