I have a object contains NaN, I would like to keep its type, after stringify.
const api = { x: 5, y: NaN }
console.log(JSON.stringify( api ));
// output '{"x":5,"y":null}'
//but I expect '{"x":5,"y":NaN}'
The reason I want to make it appear as NaN is that this json is preparing for python to process. And in the python code, they can only handle NaN, but not null. This I can not contronl