> The two concatenation approaches I know of are: > 1. via += > 2. push() into an array, join() it after the last push() > > (1) can’t possibly be efficient, > > Huh? Engines have optimized the hell out of 1 by essentially doing 2 under > the hood. Even rhino's about a land a patch to do just that. > > but if (2) is OK on all(!) platforms, then a library would be OK. However, > given how frequently this is used, I would like this to become part of the > standard library. > > What exactly do you want supported?
Something like Java’s StringBuilder. If, however, (2) collects the concatenated substrings and only joins them on demand in current engines, then there is indeed no need for such a thing. -- Dr. Axel Rauschmayer a...@rauschma.de twitter.com/rauschma home: rauschma.de blog: 2ality.com
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss