I have a value
var x = "2". How can I increment x each second so that one second from when I defined x, x will equal to 3?
Simply use the line of code:
Where someFunction is your function to change the cookies by 1 and the number is how many milliseconds do you want to wait before calling it again. So the someFunction function will be called every second!