localStorage.setItem("string", "this is a string");
let string = localStorage.getItem("string");
console.log(string)
//Result: 
//this is a string

localStorage.setItem("number", 1);
let number = localStorage.getItem("number");
console.log(number)
//Result: 
//1

localStorage.setItem("object", JSON.stringify({id: 1, name: "John Doe"}));
let object = JSON.parse(localStorage.getItem("object"));
console.log(object)

//Result: 
//{id: 1, name: 'John Doe'}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.