Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

add array to localstorage

var names = [];
names[0] = prompt("New member name?");
localStorage.setItem("names", JSON.stringify(names));

//...
var storedNames = JSON.parse(localStorage.getItem("names"));
Comment

add array to localstorage


var names = [];
names[0] = prompt("New member name?");
localStorage.setItem("names", JSON.stringify(names));

//...
var storedNames = JSON.parse(localStorage.getItem("names"));

Comment

add array to localstorage

localstorage.names = JSON.stringify(names);
var storedNames = JSON.parse(localStorage.names);
Comment

PREVIOUS NEXT
Code Example
Javascript :: express.json vs bodyparser.json 
Javascript :: javascript string first letter lowercase 
Javascript :: react copy to clipboard 
Javascript :: firebase authentication logout 
Javascript :: javascript remoev css class 
Javascript :: js reduce concat numbers 
Javascript :: moment locale 
Javascript :: remove last two elements array javascript 
Javascript :: How to remove text from a string in javscript 
Javascript :: $ is not defined 
Javascript :: aos library animation angular 
Javascript :: javascript date set time 23 59 59 
Javascript :: document ready js 
Javascript :: javascript timestamp in seconds 
Javascript :: how to output only a certain length of a string in javascript 
Javascript :: form input field readonly angular 
Javascript :: js remove undefined from object 
Javascript :: ignore logs on android expo 
Javascript :: node parameter add memory 
Javascript :: remove bearer from token in node js 
Javascript :: JavaScript performing an integer division 
Javascript :: npm react router dom 
Javascript :: scrolling for chatbot 
Javascript :: js animate scroll to the top of the page 
Javascript :: get current platform react native 
Javascript :: calculate distance between two coordinates formula javascript 
Javascript :: learn gram js 
Javascript :: react native monorepo module resolver outside app 
Javascript :: sort an array by the laster letter of element javascript 
Javascript :: linebreak eslint 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =