sessionStorage.setItem('mode','dark'); const mode = sessionStorage.getItem('mode'); console.log(mode); // 'dark'