how to put text into local storage using javascript and output list code example Example: how to add variable to local storage in javascript localStorage.setItem('key', 'value')