Local Storage let us save the data which is stored in the browser even when a user or . Let's know more about what is Local Storage in JavaScript. refreshes closes a page Local Storage holds data. Saved all data in string(JSON) format. It is also useful for web interface data. It is also used for offline storage of data. 2 - 100MB+ It has 3 three types of methods Read Data Write Data Delete Data Methods - Add key and value to local storage setItem(k,v) - Retrieve a value by the key getItem(k) - Remove an item by key removeItem(k) - Clear all storagesetItem() clear() setItem() itemsArray = { : , : } localStorage.setItem( , .stringify(itemsArray)); let id "OWUAIJFNSOTEKSMJUFTHDSUQ" name "Rahul" 'items' JSON getItem() data = .parse(localStorage.getItem( )); .log(data); const JSON 'items' console Note: JSON.parse() is used to covert the contents of back into something which we can work with later in the data variable. localStorage removeItem() When , the removeItem() method will remove that key from the storage if it exists. If there is no item associated with the given key, this method will do nothing. passed a key name localStorage.removeItem( ); 'items' clear() This method, when invoked, clears the entire storage of all records for that domain. It does not receive any parameters. localStorage.clear(); Limitations Do not store user information in localStorage. sensitive It is not a substitute for a server-based database as information is only stored on the browser. localStorage is limited to 5MB across all major browsers. localStorage is as it has no forms of data protection and can be accessed by any code on your web page. quite insecure localStorage is , meaning each operation called would only execute one after the other. synchronous 😀Thanks For Reading | Happy Coding😎 Previously published at Complete Guide To localStorage