0

var listArray = []; localStorage.setItem("cookie", listArray); //listArray is a array here, I want the cookie to get stored like an array, is this even possible?

VLAZ
  • 26,331
  • 9
  • 49
  • 67
CeeBee
  • 1
  • 2
  • 2
    Serialise it with `JSON.stringify()` then deserialise it when reading back with `JSON.parse()` – VLAZ Dec 03 '21 at 12:11
  • Could you send it in code please. I tried that and I simply didn't get it right :( – CeeBee Dec 03 '21 at 12:13

0 Answers0