Created
August 12, 2011 18:39
-
-
Save andreazevedo/1142665 to your computer and use it in GitHub Desktop.
JavaScript: octal numbers and strict mode.
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 != null) { | |
document.body.innerHTML += content; | |
} | |
document.body.innerHTML += "<br/>"; | |
} | |
function main() { | |
var intBase8 = 012; | |
var intBase10 = 12; | |
var result = (intBase8 == intBase10); | |
printLine(result); | |
} | |
</script> | |
</head> | |
<body> | |
<script> | |
main(); | |
</script> | |
</body> | |
</html> |
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 != null) { | |
document.body.innerHTML += content; | |
} | |
document.body.innerHTML += "<br/>"; | |
} | |
function main() { | |
"use strict"; | |
var intBase8 = 012; | |
var intBase10 = 12; | |
var result = (intBase8 == intBase10); | |
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