Examveda
Examveda

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

Solution(By Examveda Team)

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}.

This Question Belongs to Javascript >> Classes And Modules

Join The Discussion

Related Questions on Classes and Modules