Join GitHub today
Remove charAt calls #1173
Unfortunately string indexing isn't supported on IE7, so we can't use it yet.
The performance numbers are interesting, but actually not too surprising. I would guess that older browsers implement strings as simple arrays, making index notation the most direct access. Modern browsers use more complex structures, like ropes, to save memory and allocation time, and it's probably easier to optimize charAt, which is guaranteed to be operating on a string, than indexing, which depending on the underlying type.
I do like the [x] syntax, especially since it saves space, so this is worth revisiting once we bump the minimum requirements to IE9. That day can't come too soon, in my opinion.