https://i.stack.imgur.com/ZA32X.png
https://i.stack.imgur.com/iDHZW.png
I am facing an issue with updating the local storage of a current User for only username. When I update the username, it's not reflecting in local storage. Even though I can see the change in the component page console, I am getting a null value for the item. In the console application, local storage shows "null" as the stored key and the value is {username: gasd}, but it's not being added to that JSON object. This is using Angular 6.
let item = localStorage.getItem(this.currentUser);
console.log(item);
let myobj = {username: changeValue};
localStorage.setItem(item, JSON.stringify(myobj));