Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

local storal javascript

let storage = window.localStorage;

// set an item
storage.setItem("highscore", 76);

// get an item
let highscore = storage.getItem("highscore");

// remove an item
storage.removeItem("highscore");

// clear entire storage (NOT recommended as it also removes information about cookies, ad storage an so on)
storage.clear();
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #local #storal #javascript
ADD COMMENT
Topic
Name
6+8 =