I tried to make minimal alterations to the source code, but [bracket notation for strings is a recent addition to ECMAScript][1]. In addition to that, [charAt seems to compare well in speed][2] and is an actual string method in older standards as well. 

[1]: http://stackoverflow.com/questions/5943726/string-charatx-or-stringx "Bracket notation for strings in ECMAScript"
[2]: http://jsperf.com/charat-vs-array/3 "Bracket notation vs. charAt indexing with string data type"