I'm doing some tests with local storage. In my tests with array, i was stuck in array part (push).
What i've done:
if (localStorage.myArray) {
localStorage.myArray.push("Green");
} else {
localStorage.myArray = ["Red", "Blue"];
}
This returns an error:
Uncaught TypeError: localStorage.myArray.push is not a function
I know the localstorage itens are always string, but i don't know how this works in an array.