I am attempting to utilize JSON.parse and JSON.stringify to store and update an array in local storage. However, the process doesn't seem to be functioning as expected.
let existingArray = JSON.parse(localStorage.getItem("yesArray"));
existingArray.push("yes");
localStorage.setItem("yesArray", JSON.stringify(existingArray));
Is there something fundamentally incorrect with my approach here?