DEV Community

Discussion on: Using Local Storage for Remembering User Visits

Collapse
 
thexdev profile image
M. Akbar Nugroho

Explicitly, localStorage can only store a string value. So, if you want to store an Object then you need to serialize it using JSON.stringify() and deserialize it using JSON.parse() in order to use the Object.