4 ms·
> You should never use null in JavaScript for the value of a yet-to-determine number. Always use NaN. Actually, it is more idiomatic to use undefined for this
by brendoncrawford 15y ago
> You should never use null in JavaScript for the value of a yet-to-determine number. Always use NaN.
Actually, it is more idiomatic to use undefined for this purpose rather than NaN...
var determineLater; // undefined
var blah = 5;
blah += determineLater; // blah is now NaN