This part confused me too. When I dug around mdn docs and stackoverflow I found this explanation.
Quote from stackoverflow answer
When the argument to the isNaN function is not of type Number, the value is first coerced to a Number. The resulting value is then tested to determine whether it is NaN.
Here is the full discussion breaking down the MDN explanation for isNaN.