Question discussion

Which of the following is valid JSON?

2372Medium DSSSB TGT Computer Science 0 replies 1 views
0

Which of the following is valid JSON?

  • A{"name": "Ravi", "age": 25,}
  • B{"name": "Ravi", "age": 25}
  • C{'name': 'Ravi', 'age': 25}
  • D{name: "Ravi", age: 25}
Correct answer: B

Explanation

JSON requires double-quoted keys and strings and does not allow single quotes, unquoted keys or a trailing comma.

Discussion 0

Nobody has replied yet. Start the discussion!