Save JSON object to localStorage

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

Now you want to get data from the local storage