JSON Quiz - MCQ - Multiple Choice Questions
Q. What is JSON (JavaScript Object Notation)?
A. A data exchange formatB. A programming language
C. A web development framework
D. A database management system
Q. Which data types are supported by JSON?
A. String, Number, Boolean, Null, Object, and ArrayB. String, Integer, Float, Boolean, and Array
C. String, Number, Boolean, and Null
D. Only String and Number
Q. How do you represent a JSON object?
A. Curly braces: {}B. Square brackets: []
C. Angle brackets: <>>
D. Parentheses: ()
Q. How do you represent a JSON array?
A. Curly braces: {}B. Square brackets: []
C. Angle brackets: <>
D. Parentheses: ()
Q. What is the correct way to write a JSON string?
A. "This is a JSON string"B. 'This is a JSON string'
C. This is a JSON string
D. All of the above
Q. How do you represent a null value in JSON?
A. 0B. false
C. null
D. undefined
Q. Can a JSON object contain another JSON object as a value?
A. YesB. No
Q. What is the purpose of JSON.stringify() method?
A. To convert a JSON string into a JavaScript objectB. To convert a JavaScript object into a JSON string
C. To format a JSON string for readability
D. To validate a JSON string
Q. What is the purpose of JSON.parse() method?
A. To convert a JSON string into a JavaScript objectB. To convert a JavaScript object into a JSON string
C. To format a JSON string for readability
D. To validate a JSON string
Q. What is the difference between JSON and XML?
A. JSON is more lightweight and widely used than XML.B. XML supports more data types than JSON.
C. JSON uses curly braces, while XML uses angle brackets.
All of the above.
Q. How do you access a property of a JSON object in JavaScript?
A. obj.propertyNameB. obj[propertyName]
C. obj.getProperty(propertyName)
D. obj.get(propertyName)