Local storage and how to use it on websites
Why would a developer use local storage for a web application?
- It will store the state of application interface without forcing users to sign up and create server side account.
What information should not be stored in local storage?
- user actions and information without the user’s knowledge, password, personal information.
Local storage can store what type of data? How would you convert it to that type before storing?
- Number, string, boolean, null, object, array, custom data types; JSON.stringify method can be used to convert any datatype which is supported by JSON into a string form and can be stored. While retrieving it we will be parsing the data to convert the string to its actual form.
References