On 2/4/11, Lasse Reichstein <reichsteinatw...@gmail.com> wrote: > On Fri, Feb 4, 2011 at 7:13 PM, Michael Haufe (TNO) <t...@thenewobjective.com >> wrote: > [...] > It's generally faster to access the characters directly on the primitive > string value, e.g., > var s = "myString"; > alert(s[2]); // 'S' > instead of > var s = new String("myString"); > alert(s[2]); // 'S' > so I would prefer to not generally wrap strings just to support old > browsers.
There are still a lot of browsers that won't provide property access for uint properties like that so you'll get undefined with `s[2]`. -- Garrett -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/jsmentors@jsmentors.com/ To search via a non-Google archive, visit here: http://www.mail-archive.com/jsmentors@googlegroups.com/ To unsubscribe from this group, send email to jsmentors+unsubscr...@googlegroups.com