mozilla Flashcards
What is JSON?
A text-based data format following JavaScript object syntax. A standard text-based format for representing structured data based on JavaScript object syntax.
Who was JSON popularized by?
Douglas Crockford.
What does JSON stand for?
JavaScript Object Notation.
What is JSON commonly used for?
Transmitting data in web applications.
Give an example of how JSON can be used to transmit data in web application.
Sending some data from the server to the client, so it can be displayed on a web page, or vice versa
What does the JSON. parse() method do?
Constructs the JavaScript value or object described by the string.
What should you note about JSON even though it closely resembles JavaScript object literal syntax?
It can be used independently from JavaScript, and many programming environments feature the ability to read (parse) and generate JSON.
How does JSON exist?
As a string — useful when you want to transmit data across a network.
What do you need to do if you want to access the JSON data?
Convert it to a native JavaScript object.
Is converting JSON into a JavaScript object difficult?
No, JavaScript provides a global JSON object that has methods available for converting between the two.
What is converting a string to a native object is called?
Deserialization.
What is converting a native object to a string so it can be transmitted across the network is called?
Serialization.
Where can a JSON object be stored?
In its own file, which is basically just a text file with an extension of .json, and a MIME type of application/json.
What data types can you include in JSON?
The same basic data types as you can in a standard JavaScript object — strings, numbers, arrays, booleans, and other object literals.
What’s one way JSON differs from a JavaScript object?
An array is also valid JSON.
Does JSON contain anything other than data?
No, JSON is purely a data format — it contains only properties, no methods.
What is something JSON requires?
Double quotes to be used around strings and property names. Single quotes are not valid.
How can you validate JSON?
Using an application like JSONLint.