Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript persistent storage

//localStorage(Stores until data is cleared)
localStorage.name = 'value';
console.log(localStorage.name); // value
delete localStorage.name;
console.log(localStorage.name); // undefined

//sessionStorage(Stores until window is closed)
sessionStorage.name = 'value';
console.log(sessionStorage.name); // value
delete sessionStorage.name;
console.log(sessionStorage.name); // undefined
Comment

PREVIOUS NEXT
Code Example
Javascript :: vue watch deep property 
Javascript :: jquery validation plugin 
Javascript :: angular delete from array by name 
Javascript :: query selector by href 
Javascript :: javascript check if var is string 
Javascript :: detect touch react 
Javascript :: remove character at index 
Javascript :: vue js store and retrieve api data to localstorage 
Javascript :: MongooseError: Operation `users.insertOne()` buffering timed out after 10000ms node js 
Javascript :: add an image to a div with javascript 
Javascript :: A form label must be associated with a control react 
Javascript :: javascript wait for function to return value 
Javascript :: react check if focused 
Javascript :: redirect via javascript 
Javascript :: redirect to another domain javascript 
Javascript :: math format comma separated in javascript 
Javascript :: jquery datepicker set default date 
Javascript :: regex detect negative numbers 
Javascript :: react material ui media queries 
Javascript :: inner content 
Javascript :: document get element by id style 
Javascript :: jquery page finished loading 
Javascript :: validatorjs get all errors 
Javascript :: declaration vue 3 variables 
Javascript :: js create element from string 
Javascript :: express get ip address of request 
Javascript :: run a loop inside a console.log no blank line 
Javascript :: how to register key presses in p5.js 
Javascript :: asp.net core 3.1 convert system.string[] to javascript 
Javascript :: javascript get second last element in array 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =