I encountered this lack of support when sending an object from an expressJS server using res.json(). When Infinity value was present the client-side was receiving the value null in its place.
I'm just posting what I did for my particular scenario, as it may be useful to someone coming here for a similar scenario.
In my particular instance the possible options for this specific value where either a number or Infinity.
So I ended up converting that value to a string with toString() (so a number, for example, 250 would become a string '250' and Infinity would become 'Infinity').
Then on the client-side I would convert the value to a number using Number(). That would revert Infinity to the number type Infinity.
So here is what it looks like:
The Object
myObj = {
numberValue: Infinity, // or some other number
otherKey: 'otherValue'
}
On server
myObj.numberValue = myObj.numberValue.toString();
res.json(myObj);
On client
fetch('/some-path', options)
.then(res => res.json())
.then(data => {
data.numberValue = Number(data.numberValue);
// do stuff with the data
})