Skip to content

Instantly share code, notes, and snippets.

@cheng470
Created December 23, 2014 05:41
Show Gist options
  • Save cheng470/f4573dc04a7c0eaef011 to your computer and use it in GitHub Desktop.
Save cheng470/f4573dc04a7c0eaef011 to your computer and use it in GitHub Desktop.
由于 NaN 是 JavaScript 中唯一一个不等于其自身的值,因此,你可以随时通过检查一个值是否等于其自身的方式来测试该值是否是 NaN。
function isReallyNaN(x) {
return x !== x;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment