JS and JSON Flashcards
How do you deserialize a JSON string into a data structure using JavaScript?
JSON.parse( )
How do you serialize a data structure into a JSON string using JavaScript?
JSON.stringify( )
What are serialization and deserialization?
Serialization: converting complex data (like an object) to string
Deserialization: converting string to object
What is JSON?
JavaScript Object Notation (JSON) is a standard text-based format for representing structured data based on JavaScript object syntax.
Why are serialization and deserialization useful?
<b>Serialization</b> allows from data to be stored in memory. Also makes it easier to transfer data across a network.
<b>Deserialization</b> makes it so that data is easier to interact with.