Possible Duplicate:
Deleting from localStorage: should I use delete or .removeItem?
What is the difference between
localStorage.removeItem("my_variable_in_storage")
And
delete(localStorage.my_variable_in_storage)
Besides that first returns "undefined" and second true boolean.
You should use localStorage.removeItem()
. While delete may work, it's not part of the spec and it may just be a lucky coincidence that it's working for you right now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With