
Ian M. answered 03/26/19
Web Development Specialist, Expert JavaScript Programmer
There's a very easy answer to this: NaN is supposed to indicate that there's an error in your math calculations. If NaN === NaN were true, then NaN could easily be converted back into a number like so:
If NaN === NaN then z would be 1, hiding that there was a problem in the calculation of both x and y. Instead, z is NaN, which should indicate that a problem happened somewhere along the line.
Ian