Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I want to convert array to json object in js or jquery.
Is there any function is available or lib
Thanks in advance
In modern browsers you can simply use
JSON.stringify(someJSObject)
to convert any JavaScript object (that includes arrays) to a JSON string.
To ensure it also works in less modern browsers, include
https://github.com/douglascrockford/JSON-js/blob/master/json2.js
on your page.
–
–
–
–