I have a script in JavaScript which is called several times in a html page. I want to know how it's possible to assign values to a variable only the first call of the script.
var processingYear = 0;
var recupMonth = 0;
var recupYear = 0;
if(processingMonth == startMonth && processingYear == startYear && recupMonth == 0 && recupYear == 0){
recupMonth = startMonth;
recupYear = startYear;
}