本地存储 localStorage/sessionStorage
2019-12-12 本文已影响0人
逸笛
localStorage存储数组以及取数组方法
var Array = ['A',' B ','C','D','E']
存:localStorage.setItem('arr',JSON.stringify(Array));取:
Array = JSON.parse(localStorage.getItem('arr'));
var Array = ['A',' B ','C','D','E']
存:localStorage.setItem('arr',JSON.stringify(Array));取:
Array = JSON.parse(localStorage.getItem('arr'));