Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

to do list local storage javascript

// for getting data from local storage
const getLocalStorage = () => {
 let task = localStorage.getItem('task')
 if (task) {
  return (task = JSON.parse(localStorage.getItem('task')))
 }
 else {
  return []
 }
}

// for writing to local storage
localStorage.setItem('task', JSON.stringify(task))
Comment

PREVIOUS NEXT
Code Example
Javascript :: web3 js get network 
Javascript :: angular rellax 
Javascript :: Use parseInt() in the convertToInteger function so it converts a binary number to an integer and returns it. 
Javascript :: htpp code 
Javascript :: js regex for password 
Javascript :: if variable is string javascript 
Javascript :: javascript object instead of switch 
Javascript :: xpath nodejs 
Javascript :: regex e-mail 
Javascript :: how to give css style in javascript 
Javascript :: v-btn click 
Javascript :: how to get date in footer javascript 
Javascript :: TypeError: Class constructor Model cannot be invoked without 
Javascript :: add 2 for hours in date timestamp js 
Javascript :: use effect react 
Javascript :: Environment key "jest/globals" is unknown 
Javascript :: react native picker 
Javascript :: webpack file-loader 
Javascript :: js queryselector find without attribute 
Javascript :: comments js 
Javascript :: match city regex 
Javascript :: ReactJS Axios Delete Request Code Example 
Javascript :: how to export mongodb database to json 
Javascript :: how reliable is js hasownproperty 
Javascript :: set localstorage value 
Javascript :: json full form 
Javascript :: bracket notation javascript 
Javascript :: bun react 
Javascript :: no special characters express validator 
Javascript :: bootstrap react 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =