Encountering Another Issue. Here's the Relevant Code:
if(localStorage.getItem("temporaryArray")){
var temporaryArray = JSON.parse(localStorage.getItem("temporaryArray"));
}else{
var temporaryArray = [];
}
Essentially, what this code snippet does is prevent resetting of the array when a new page loads to ensure that data assigned to it in localStorage persists. If 'temporaryArray' can be retrieved, then reassign it to the localStorage item upon reload. Otherwise, initialize it as an empty array. However, I'm encountering an error likely due to the current emptiness of the array:
Uncaught SyntaxError: Unexpected token o in JSON at position 1
at JSON.parse (<anonymous>)
at main.js:61
Any assistance on resolving this issue would be greatly appreciated.