Created
August 16, 2011 02:05
-
-
Save andreazevedo/1148296 to your computer and use it in GitHub Desktop.
Odd NaN feature in JavaScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script> | |
function printLine(content) { | |
if (content) { | |
document.body.innerHTML += content; | |
} | |
document.body.innerHTML += "<br/>"; | |
} | |
function main() { | |
var x = 0 / 0; | |
var result = (x == x); | |
printLine(result); | |
} | |
</script> | |
</head> | |
<body> | |
<script> | |
main(); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This gist is related to the following article: http://andreazevedo.org/2011/08/15/odd-nan-feature-in-javascript/