// 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))