Serialize a value so that equal values always produce equal strings.
JSON.stringify preserves insertion order, so two objects holding the same entries serialize
differently and would look like two different things. Object keys are sorted here, at every depth,
which is what makes the result usable as an identity.
Arrays keep their order, because in an array order is meaning.
Serialize a value so that equal values always produce equal strings.
JSON.stringifypreserves insertion order, so two objects holding the same entries serialize differently and would look like two different things. Object keys are sorted here, at every depth, which is what makes the result usable as an identity.Arrays keep their order, because in an array order is meaning.