so I have problem with basics cause my variable when i add 1 or just increment gives back nan I don't really know if it's problem with saving or it just can't add. here is code that contains that variable
let add;
if(localStorage.getItem("add")>=1){
add=localStorage.getItem("add");
}
else {
add = 1;
localStorage.setItem("add", add);
}
function oncl(){
add = add++;
localStorage.setItem("add",add);
}
nan means it is not a number because localStorage.getItem() returns a string not a number so you need to parse it into a number first then you can do numbers operations
if you are using integers use
parseInt(localStorage.getItem("add"))
//you can also use parseFloat() or Number()