how to store a variable in local storage and add to it code example Example: how to add variable to local storage in javascript localStorage.setItem('key', 'value')