files/en-us/web/api/notrestoredreasons/tojson/index.md
{{APIRef("Performance API")}}{{SeeCompatTable}}
The toJSON() method of the {{domxref("NotRestoredReasons")}} interface is a {{Glossary("Serialization","serializer")}}; it returns a JSON representation of the {{domxref("NotRestoredReasons")}} object.
toJSON()
None.
A {{jsxref("JSON")}} object that is the serialization of the {{domxref("NotRestoredReasons")}} object.
The following function will return a JSON representation of the NotRestoredReasons object of the first PerformanceNavigationTiming object currently present in the performance timeline:
function returnNRR() {
const navEntries = performance.getEntriesByType("navigation");
let navEntry = navEntries[0];
return navEntry.notRestoredReasons.toJSON();
}
{{Specifications}}
{{Compat}}