how to use local storage item in another javascript file code example Example: how to get variable in local storage in javascript localStorage.getItem('id');