How To Store Array In Localstorage?
I have to store an array in window.localStorage. How would I store the array in window.localStorage using console window? EX: cards: Array[0] length: 0 I have to store this. Now h
localStorage
only support string
so you'll have to parse it to JSON
var arr = ["hello", "how", "are", "you", "doing"];
localStorage.setItem("test", JSON.stringify(arr));
Post a Comment for "How To Store Array In Localstorage?"