JSON.stringify converting Infinity to null

Like the other answers stated, Infinity is not part of the values JSON can store as value.

You can reverse the censor method on parsing the JSON:

var c = JSON.parse(b, function (key, value) {
    return value === "Infinity" ? Infinity : value;
});

Leave a Comment