Baseline Widely available
The clear()
method of the Storage
interface clears all keys stored in a given Storage
object.
None.
Return valueNone (undefined
).
The following function creates three data entries in local storage, and then deletes them by using clear()
.
function populateStorage() {
localStorage.setItem("bgcolor", "red");
localStorage.setItem("font", "Helvetica");
localStorage.setItem("image", "miGato.png");
localStorage.clear();
}
Note: For a real-world example, see our Web Storage Demo.
Specifications Browser compatibility See alsoRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4