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?
localStorage.setItem("foo", val)
if (localStorage.getItem("foo") !== val)
1.4m articles
1.4m replys
5 comments
57.0k users