Sorry, but this article could be a bit misleading to newbie devs. It doesn't describe that accessing localStorage could result in a SecurityError (thus robust web apps should wrap LS access in a try-catch or similar mechanism), and the size of LS is not always equal to 5 MiB (on older Androids it is smaller, for example).
How’s it going, I'm a Adam, a Full-Stack Engineer, actively searching for work. I'm all about JavaScript. And Frontend but don't let that fool you - I've also got some serious Backend skills.
Location
City of Bath, UK 🇬🇧
Education
10 plus years* active enterprise development experience and a Fine art degree 🎨
Sorry, but this article could be a bit misleading to newbie devs. It doesn't describe that accessing localStorage could result in a
SecurityError
(thus robust web apps should wrap LS access in a try-catch or similar mechanism), and the size of LS is not always equal to 5 MiB (on older Androids it is smaller, for example).It would be fair to provide a link to MDN: developer.mozilla.org/en-US/docs/W..., which describes LS in greater details.
Session storage would be a better alternative also or no client side storage at all, even better, for legal and security reasons.