Created
July 27, 2011 03:37
-
-
Save DavidQL/1108622 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(function() { | |
// convert a string to a number. | |
// it uses base 10 by default | |
var foo = parseInt('78'); // 78 | |
// repeat, with a different number | |
// this time it's base 8 by default? | |
var wtf = parseInt('08'); // 0 | |
// always provide parseInt() | |
// with a base 10 param | |
// var allbetter = parseInt('08', 10); // 10 | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment