Is there a limit to the key length for localStorage?
Is there any limit (up to the amount of local storage available) for the key when using localStorage?
i.e. can I do something like:
localStorage.setItem("pretend that this is a 1MB string", "whatever");
Yes, the limit is 5MB per domain. Your string can be as long as you want. The total usage must, however, be under 5 MB.