Atur reaksi penyimpanan

const textForStorage = 'Hello World.'

// setter
localStorage.setItem('my-key', textForStorage);

// getter
const textFromStorage = localStorage.getItem('my-key');
Anghel Marius