Q
Which string is valid JSON?
-
A
{'name': 'Karachi', 'temp': 35}
-
B
{"name": "Karachi", "temp": 35,}
-
C
{name: "Karachi", temp: 35}
-
D
{"name": "Karachi", "temp": 35}
Correct Answer:
D. {"name": "Karachi", "temp": 35}
Explanation:
JSON requires double-quoted keys and strings, and allows no trailing commas and no comments.