JSON Flashcards
What is JSON?
Javascript object notation format for storing and transporting the data
What are serialization and deserialization?
Serialization convert an object into a string, Deserialization convert string in to object
Why are serialization and deserialization useful?
Easier to transfer data
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()
How to you store data in localStorage?
localstorage.setItem(key name, key value)
How to you retrieve data from localStorage?
localstorage.getItem(key name)
What data type can localStorage save in the browser?
String
When does the ‘beforeunload’ event fire on the window object?
When the window, the document and its resources are about to be unloaded.