Home > Internet Programming > Quizzes > JSON Fundamentals Test
JSON Fundamentals Test
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 26% Most missed: “What keywords are reserved in JSON and cannot be used as keys?”
JSON Fundamentals Test
Time left 00:00
25 Questions

1. Which of the following code will throw an error?
2. What function will convert a JavaScript object to a JSON string?
3. In this example - what would the TYPE of employee.hireDate be? { 'employee' : { 'type' : 'Director' - 'functions' : ['sales' - 'marketing'] - 'hireDate' : 'March 8 - 2011' } }
4. Which answer represents the following order of TYPES? Object - String - Boolean - Number
5. JSON strings have to be in
6. What is the return value for JSON.parse()?
7. How does JSON being 'lightweight' translate into a benefit for the site visitors?
8. What is used by the JSONObject and JSONArray constructors to parse JSON source strings?
9. What is the value of obj in the following code? var obj = JSON.parse('{'fruit': 'Apple'}' - function(k - v) { if (v == 'Apple') return 'Orange' else return v; });
10. How does JSON handle numeric values that cannot be represented by a sequence of digits (like Infiniti and Nan)?
11. Which of the following control characters cannot be used when writing a JSON string without escaping?
12. In the below notation - Employee is of type { 'Employee': [ 'Amy' - 'Bob' - 'John' ] }
13. What two structures is JSON built on?
14. What is the value of json in the following code? var obj = { fruit: 'apple' - toJSON: function () { return 'orange'; } }; var json = JSON.stringify({x: obj});
15. What keywords are reserved in JSON and cannot be used as keys?
16. In this example - what would the VALUE of employee.functions[1] be? { 'employee' : { 'type' : 'Director' - 'functions' : ['sales' - 'marketing'] } }
17. Which of these is correct about the JSON standard?
18. What is a JSONStringer used for?
19. In the below notation - Employee is of type { 'Employee': { 'Name': 'Amy' - 'Age': 25 } }
20. Which statement about the toJSON method is true?
21. Can you use a double quote inside a JSON string?
22. Which of these is proper a JSON array?
23. In this example - what is the TYPE of employee? { 'employee' : { 'type' : 'Director' - 'functions' : ['sales' - 'marketing'] } }
24. Of the structures that encompass a value - which can be nested?
25. In what situation would you want to use XML over JSON?