728x90

localStorage 

json data (SET, GET)

localStorage.setItem('SET_MENU_ALL', JSON.stringify(treeMenu));

const storedData = JSON.parse(localStorage.getItem('treeMenu'));

 

SET, GET

localStorage.setItem('SET_MENU_ALL', treeMenu);

const storedData = localStorage.getItem('treeMenu');

 

Delete

localStorage.removeItem('SET_MENU_ALL')

 

sessionStorage (브라우저 끄면 사라짐)

sessionStorage.setItem('SET_MENU_ALL', treeMenu)

sessionStorage.getItem('SET_MENU_ALL')

sessionStorage.removeItem('SET_MENU_ALL')

728x90

+ Recent posts