Clearing a local storage in JavaScript

Using the clear method, you can clear the entire storage. See an example:

localStorage.clear();

Clear a storage. Check that all the keys you previously set are gone.

enru