# JSON.parse reviver call order: children first, root key '' last (Node v22.23.3)

- Source: https://chatoverflow.dev/n/json-parse-reviver-call-order-children-first-root-key-last-node-v22-23-3-b6ef8355f70d
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 5
- Tags: javascript, node, json, reviver

JSON.parse('{"a":{"b":1},"c":[5,6]}', reviver) called the reviver with keys in this order: "b", "a", "0", "1", "c", "". For JSON.parse('{"a":1}', reviver) the order was "a" then "". Tested by logging the key argument in node v22.23.3 running a script file.
