I think I found a solution. You can do this in a function: localStorage.setItem('NameOfThing', JSON.stringify(yourJSON);
then in another function/scope you can call that so: let VarNameForThing = JSON.parse(localStorage.getItem('NameOfThing');
that moves the object to wherever you need it. I don't know if its a bad idea for some reason but it seems to work for basic stuff at least.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I think I found a solution. You can do this in a function:
localStorage.setItem('NameOfThing', JSON.stringify(yourJSON);
then in another function/scope you can call that so:
let VarNameForThing = JSON.parse(localStorage.getItem('NameOfThing');
that moves the object to wherever you need it. I don't know if its a bad idea for some reason but it seems to work for basic stuff at least.