HTML5 localStorage lets you store key/value pairs of data. Both key and value needs to be a string.
To store arrays as a key or value you need to encode the array into a JSON string. And while retrieving you need to decode it back to an array.
Here is example code
localStorage.setItem("array", JSON.stringify(array));
array = JSON.parse(localStorage.getItem("array"));
console.log(typeof array); //object
console.log(array); //[1, 2, 3]