-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storing a number converts it into a string #99
Comments
local storage doesn't store values by type. It is simply a string key,value pair store. Trying the following in chrome's console yields the same results. window.localStorage.setItem('wat', 11) But I think that it would be a great idea to implement some support for primitive javascript types here. |
This is confusing to me, because if you store an object, you get an object back. If you store this, for example: Then, the inner number (99) doesn't get converted. I guess I'm struggling to understand when the object will come back unchanged, and when it will come back with some parts turned into a string. |
That's true. Someone did a PR to maintain the type of Object. We could add it in for Number as well. |
Perhaps we could just serialize/deserialize everything? |
Please excuse my ignorance on how these things work, but does the above committed test spec imply that there are plans to return ints as ints instead of strings? |
@deweydb that's right, If you save a |
Strange, I am still having ints being converted into strings in Chrome. I will produce an example later today and post it. |
@deweydb Which version are you using currently? |
The text was updated successfully, but these errors were encountered: