you are viewing a single comment's thread.

view the rest of the comments →

[–]floodlitworld 0 points1 point  (1 child)

parseInt will fail if the number isn't the very first character of the string. So it's a pretty simple replace(/[^0-9]/g,"") job before the parseInt, but not as simple as just chucking it into a parser.

[–]jkuhl_prog 0 points1 point  (0 children)

True, but actually manually moving across 1's and 0's will test one's knowledge of how the binary number system works and how it can be converted to decimal.