0

I am building an online os and have an issue. Is it possible to add data to the current values ​​of the local storage object without removing the current values​​?

2
  • what type of data do you want to add? arrays, lists, objects, strings, numbers? Commented Jul 27, 2011 at 15:45
  • Just set the value equal to the current value plus whatever you want to append to it? No need to remove it. Commented Oct 24, 2011 at 15:08

1 Answer 1

5

Kind of. All local storage variables (as far as I know. correct me if I'm wrong) are stored as strings. So "adding" a bit of data to a local storage variable could be done by appending it to the existing value. e.g.

localStorage["myHandle"] += "blah"; 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.