Which would be more efficient?
Repeatedly running localStorage.setItem("foo", val)
, or checking if (localStorage.getItem("foo") !== val)
and then running localStorage.setItem("foo", val)
? Is it fine to run these as often as every two seconds?
Which would be more efficient?
Repeatedly running localStorage.setItem("foo", val)
, or checking if (localStorage.getItem("foo") !== val)
and then running localStorage.setItem("foo", val)
? Is it fine to run these as often as every two seconds?