utilities/localstorage.js
// Function to get something from local storage (parse)
Function to get something from local storage (parse)
Function to get something from local storage ( parse )
function parseJSONFromLocalStorage(key, defaultValue) {
  const json = JSON.parse(localStorage.getItem(key));
  if (!json) {
    return defaultValue;
  }
  return json;
}
function parseJSONFromLocalStorage ( key , defaultValue ) { const json = JSON . parse ( localStorage . getItem ( key ) ) ; if ( ! json ) { return defaultValue ; } return json ; }
Function to get something from local storage (parse)
Function to get something from local storage ( parse )