O'Reilly logo

Isomorphic Go by Kamesh Balasubramanian

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required