12846 shaares
323 private links
323 private links
Some pitfalls and cases where JSON has a default behavior.
Date, BigInt, circular dependencies, undefined property are not preserved and leads to different behaviors.
Serialization executes code and toJSON().
Take care of prototype pollutions (for example a __proto__ property).
There are also optimization with Message Pack that provides a compact ninary representation and CBOR.