Also mentioned in Crockford's "Javascript: The Good Parts":
parseInt()
is dangerous. If you pass it a string without informing it of the proper base it may return unexpected numbers. For example parseInt('010')
returns 8, not 10. Passing a base to parseInt makes it work correctly:
parseInt('010') // returns 8! (in FF3)
parseInt('010', 10); // returns 10 because we've informed it which base to work with.