toJSON() method is a serializer that returns
a JSON representation of the
json = resourcePerfEntry.toJSON();
- A JSON object that is the serialization of the
PerformanceResourceTimingobject as a map with entries from the closest inherited interface and with entries for each of the serializable attributes.
// Get a resource performance entry var perfEntries = performance.getEntriesByType("resource"); var entry = perfEntries; // Get the JSON and log it var json = entry.toJSON(); var s = JSON.stringify(json); console.log("PerformanceEntry.toJSON = " + s);
|Resource Timing Level 2
The definition of 'toJSON' in that specification.
BCD tables only load in the browser