how to add function to localstorage in javascript code example Example: how to get variable in local storage in javascript localStorage.getItem('id');