DEV Community


Discussion on: What is localStorage?

sudarshansb143 profile image
Sudarshan Sawandkar

But if you designed multiple games and stored the high scores of all in local storage then you call clear().

Then will it clear all high scores or only clear that specific games high score in which you call clear() ?

3in0 profile image

Yes, that would clear all local storage for everything hosted under the same host/port. I guess if you wanted to just clear the data for one page/game you'd just delete or reset the key/value pairs associated with that page rather than use clear().

Thread Thread
tolentinoel profile image
Ellaine Tolentino Author

Oh yes! this is a good thing to point out! Thank you!

Forem Open with the Forem app