Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

local storage javascript array

//storing array in localStorage
var colors = ["red","blue","green"];
localStorage.setItem("my_colors", JSON.stringify(colors)); //store colors
var storedColors = JSON.parse(localStorage.getItem("my_colors")); //get them back
Comment

localstorage javascript array

// Guardar el array en el localStorage

// El arreglo:
var array = [1, 2, 3];
// Se guarda en localStorage despues de JSON stringificarlo 
localStorage.setItem('myArray', JSON.stringify(array));

// Obtener el arreglo de localStorage

var array = localStorage.getItem('myArray');
// Se parsea para poder ser usado en js con JSON.parse :)
array = JSON.parse(array);
Comment

PREVIOUS NEXT
Code Example
Javascript :: save on focus lost sublime 
Javascript :: js save local storage 
Javascript :: nodejs get file size 
Javascript :: delete first character javascript 
Javascript :: check window resize javascript 
Javascript :: how to remove https link from javascript 
Javascript :: javascript reduce function to get sum of object value 
Javascript :: sequelize exclude attribute 
Javascript :: jquery smooth scrool 
Javascript :: react native italic text 
Javascript :: window.onload 
Javascript :: a-z array javascript 
Javascript :: setpresence discord.js 
Javascript :: generate random date in javascript 
Javascript :: node js pre-commit hook bypass 
Javascript :: jquery onchange 
Javascript :: how to add a right click listener javascript 
Javascript :: js queryselector names 
Javascript :: jquery json decode 
Javascript :: js random string 
Javascript :: javascript string into substrings of length 
Javascript :: get all mondays in calendar+js 
Javascript :: js proxy to array 
Javascript :: get the first number of the integer in js 
Javascript :: javascript readfile 
Javascript :: Javascript function to get the difference between two numbers 
Javascript :: javascript get age 
Javascript :: yarn create strapi-app 
Javascript :: react material ui button router link 
Javascript :: convert utc time to local time moment 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =