Why this matters: This information matters because local storage allows developers to maintain the state of an interface and to store web service data (leading to faster loading times), among other things.
Source: https://www.smashingmagazine.com/2010/10/local-storage-and-how-to-use-it/
1. Why would a developer use local storage for a web application?
As HTTP is stateless, devs need to store the state of their interface somewhere to preserve its most recent state (and for faster loading times). When storing it server-side isn’t an option, you need local storage.
2. What information should not be stored in local storage?
Personal information, as local storage can be exploited.
3 Local storage can store what type of data? How would you convert it to that type before storing?
Strings! You can convert it using the JSON.stringify()
and JSON.parse
methods.
Nothing at the moment!