Discussion :: Javascript - CS
- 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 |
Answer : Option C
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}.
Be The First To Comment