Languages
[Edit]
EN

JavaScript - deserialize json to object

8 points
Created by:
lena
714

In JavaScript, it is possible to deserialize (parse/convert) objects to JSON in the following ways.

1. JSON.parse method example

Edit

Note: JSON.parse method has been introduced in ES5.

2. eval method example 

Edit

Note: this approach is not recommended if JSON.parse method is available because of security - eval parse and execute all source code - can be dangerous if comes from outside.

See also

Edit
  1. JavaScript - serialize object to json

Merged questions

Edit
  1.  JavaScript - how to parse object to json?
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

JavaScript - JSON

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join