set local storage in javascript

index.tsx
//To set an item in local storage:
localStorage.setItem('key', 'value');

//To retrieve an item from local storage:
const value = localStorage.getItem('key');

//To remove an item from local storage:
localStorage.removeItem('key');

//To clear the entire local storage:
localStorage.clear();
292 chars
12 lines

gistlibby LogSnag