Setting a key-value pair

To store an item into local storage, we call the setItem method of the localStorage object, and pass in the key and value as parameters to the method:

localStorage.setItem("foo", "bar"); 

Here we have provided a "foo" key, with a "bar" value.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.239.44