How to add item to localstorage in JavaScript

Storage
By Jad Joubran · 
Last updated Dec 19, 2017
const name = "John";

localStorage.setItem("name", name);