if (typeof(myObj.myNum) == 'number') {/* do this */}
else if (myObj.myNum.isNaN) {/* do that*/}
else if (myObj.myNum.isInfinity) {/* Do another thing */}
JSON.parse(theString.replace(/":(Infinity|-IsNaN)/g, '":"\{\{$1}}"'), function(k, v) {
if (v === '\{\{Infinity}}') return Infinity;
else if (v === '\{\{-Infinity}}') return -Infinity;
else if (v === '\{\{NaN}}') return NaN;
return v;
});