On 2/4/11, Lasse Reichstein <[email protected]> wrote: > On Fri, Feb 4, 2011 at 7:13 PM, Michael Haufe (TNO) <[email protected] >> 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/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
