Save JSON object to localStorage

Last Updated: August 27, 2021

You want to save JSON onbject to localstorage in your browser?. You can use the following code

 localStorage.setItem("setting", JSON.stringify(response.data))

Now you want to get data from the local storage

JSON.parse(localStorage.getItem('setting'))