use isNaN and parseInt for fasterness

Using `isNaN(parseInt(digit, 10))` is faster than `unless /^\d+$/.test(digit)` (see [jsperf](http://jsperf.com/test-if-number-2)), and I think reads a little cleaner. The unary operator (`+digit`) is essentially a shorthand for `Number(digit)`, which looks even cleaner but is slightly slower.