Some background:
I write numerical programs.
I usually write them in C++ and then translate them to JavaScript for posting on a web page.
In C++, I like to initialize variables to NaN using the C++ function quiet_NaN().
That way, if a user misses the error message indicating not all results are valid, he will hopefully notice the NaN numbers when the results are output. It acts like a double back-up.
I mean, if he sees output like the following, he should note that something is wrong and go back to check the inputs, or the program, or know that results could simply not be computed.
Code:
0.7816874228759403
0.7816874228173526
0.7816874228123456
NaN
NaN
0.7816874228876543
0.7816874228788223
0.7816874228111234
0.7816874228998733
0.7816874228876876
My question: is there a JavaScript equivalent of quiet_NaN()?

Let's say I have a one-dimensional array of type double variables, 1000 entries long, called ResultArray.
I would like to take C++ code similar to the following

Code:
// Initialize all entries of this array to NaN
for (var i = 0; i < 1000; i++){
 ResultArray[i] = std::numeric_limits<double>::quiet_NaN();
}
and create similar code in Javascript.

Can this be done? If so, how?