JSON.stringify convertendo Infinity para null

Eu tenho JavaScript Object dizer:

var a = {b: Infinity, c: 10};

Quando eu faço

var b = JSON.stringify(a);

ele retorna o seguinte

b = "{" b ": null," c ": 10}";

Como o JSON.stringify converte o objeto em strings?

eu tenteiSolução MDN.

function censor(key, value) {
  if (value == Infinity) {
    return "Infinity";
  }
  return value;
}
var b = JSON.stringify(a, censor);

Mas neste caso eu tenho que retornar a string "Infinity" nãoInfinity. Se eu retornar Infinity, ele converterá Infinity novamente em null.

Como eu resolvo este problema.

questionAnswers(3)

yourAnswerToTheQuestion