πŸ“Š Machine Learning
Q. The property of JSON() method is:
  • (A) it can be invoked manually as object.JSON()
  • (B) it will be automatically invoked by the compiler
  • (C) it is invoked automatically by the JSON.stringify() method
  • (D) it cannot be invoked in any form
πŸ’¬ Discuss
βœ… Correct Answer: (C) it is invoked automatically by the JSON.stringify() method

Explanation: The JSON format is intended for serialization of data structures and can handle JavaScript primitive values, arrays, and plain objects. It does not know about classes, and when serializing an object, it ignores the object’s prototype and constructor. If you call JSON.stringify() on a Range or Complex object, for example, it returns a string like {“from”:1, “to”:3} or {“r”:1, “i”:-1}.

Explanation by: Mr. Dubey
The JSON format is intended for serialization of data structures and can handle JavaScript primitive values, arrays, and plain objects. It does not know about classes, and when serializing an object, it ignores the object’s prototype and constructor. If you call JSON.stringify() on a Range or Complex object, for example, it returns a string like {“from”:1, “to”:3} or {“r”:1, “i”:-1}.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
100
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
91%
Success Rate