Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8946195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:26:51+00:00 2026-06-15T12:26:51+00:00

Array of JSON objects are stored in HTML5 localStorage . For now delimiter is

  • 0

Array of JSON objects are stored in HTML5 localStorage.
For now delimiter is ;
For accessing and modifying array of objects from localStorage, split(';') and join(';') operations used.

However ,delimiter approach looks unstable.
For instance ; could be met inside objects attribute and split(';') operation will be uncorrect.

It could be used ;; for delimiter,but i’m not certain it will be stable also.

Is there any robust way to handle localStorage presented as array of objects,as far localStorage saved as String?

EDIT

one of stoppers is that array of object couldn’t be saved to localStorage as classical: "[{},{}]"
localStorage converts it automatially to String like "{},{}"

my current data within localStorage:

"{"name":"volvo","id":"033"};{"name":"saab","id":"034"}"

assumption
perhaps,i can add [ at the start and ] at the end,but it looks not gracefull

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T12:26:52+00:00Added an answer on June 15, 2026 at 12:26 pm

    Just convert the objects to JSON strings:

    localStorage.setItem("savedData", JSON.stringify(objects));
    

    And vice versa:

    objects = JSON.parse(localStorage.getItem("savedData")));
    

    Or you can add multiple objects in the same localStorage value:

    localStorage.setItem("savedData", JSON.stringify([object1, object2 /*, etc*/]));
    object1 = JSON.parse(localStorage.getItem("savedData"))[0];
    object2 = JSON.parse(localStorage.getItem("savedData"))[1];
    

    Here’s the DOM storage specification.

    You can also access savedData like this:

    localStorage.savedData = "Hello world"
    var foo = localStorage.savedData;
    

    This can be used for both getting and setting the data, but it is considered less “safe” than getItem('name'); and setItem('name', 'value');

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bunch of JSON objects stored in an array in JQuery. Is
I have an array of json objects like so: [{a:b},{c:d},{e:f}] What is the best
Given the following array of json objects: var items = [ {id:1, parentId:0, name:'item1'},
Is there a really easy way I can take an array of JSON objects
I'm loading JSON data (array of objects) via service, onReady, and want to display
I'm trying to get a list of JSON objects (products) from a local file
I commonly see data stored in JSON objects/arrays in open sourced Android code. Why/When
The Good: We send a JSON array of nested objects using JQuery and .ajax().
I am trying to store an array in localStorage (HTML5) which needs to be
I have JSON as follows: [{0:1,id:1,1:abc,name:abc},{0:2,id:2,1:xyz,name:xyz}] It is an array of objects. I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.