> Except if you want to store objects/arrays/numbers (localStorage only supports strings)
My normal usage of localStorage usually looks like this:
const getItem = (item) => { JSON.parse(window.localStorage.getItem(item)) }
// and
const setItem = (item, val) { window.localStorage.setItem(item, JSON.stringify(val)) }
And then you won't have issues with any type.