I want to export a few items from my localStorage to save it externally but in a format so that I can import it again later.
My attempt was to write executable code that
You can encode Objects into Strings using JSON.stringify (object to String) and decode Strings into Objects using JSON.parse (String to Object).
Write to localStorage
localStorage.setItem("varname",JSON.stringify(originalVarname));
Read from localStorage
var originalVarname= JSON.parse(localStorage.getItem("varname"));