JSON Flashcards
What is JSON?
data interchange format used to send and store information in computer systems.
or
a format for exchanging data
What are serialization and deserialization?
Serialization is the process of turning an object in memory into a stream of bytes so you can do stuff like store it on disk or send it over the network.
Deserialization is the reverse process: turning a stream of bytes into an object in memory.
Why are serialization and deserialization useful?
we can send info anywhere
How do you serialize a data structure into a JSON string using JavaScript?
json.stringify
How do you deserialize a JSON string into a data structure using JavaScript?
json.parse method
How to you retrieve data from localStorage?
getitem method
What data type can localStorage save in the browser?
json
When does the ‘beforeunload’ event fire on the window object?
when its about to be refreshed
How to you store data in localStorage?
set item method