Have a node.js app that is receiving JSON data strings that contain the literal NaN, like
\"[1, 2, 3, NaN, 5, 6]\"
This crashes JSON
The correct solution is to recompile the parser, and contribute an "allowNan" boolean flag to the source base. This is the solution other libraries have (python's comes to mind).
Good JSON libraries will permissively parse just about anything vaguely resembling JSON with the right flags set (perl's JSON.pm is notably flexible)... but when writing a message they produce standard JSON.
IE: leave the room cleaner than you found it.