If you've shipped anything to the browser, you've used localStorage. And if you've used it for more than five minutes, you've also written this exact line more times than you'd like to admit:
const user = JSON.parse(localStorage.getItem('user') || 'null')
Enter fullscreen mode
Exit fullscreen mode
The Web Storage API has aged remarkably well for something so small, but it carries three persistent pain points that every frontend codebase ends up papering over by hand.






