✅ – kairu – 16-47 Oct 31

is there a better way to do
JSON.parse(JSON.stringify(localStorage.getItem('user')))
JSON.parse(JSON.stringify(localStorage.getItem('user')))
?
L
Louis535d ago
Why do you need to stringify the value in local storage? It's a key value pair so I imagine you'd be storing a stringified JSON object as the value here anyway
C
chocokai535d ago
it wouldn't let me parse through it without running stringify then parse and saving the object in local storage would only return object Object
L
Louis535d ago
You should stringify it before persisting it and parse it after retrieving it
C
chocokai535d ago
OK i'll that that real quick
UU
Unknown User535d ago
L
Louis535d ago
Awesome meowthumbsup
UU
Unknown User534d ago