3 ms·
In most modern browsers Array.join and += are about equal in performance for most use cases. Depending on the length of the strings and/or the number of segment
by FlemishBeeCycle 16y ago
In most modern browsers Array.join and += are about equal in performance for most use cases. Depending on the length of the strings and/or the number of segments joined - performance varies. Wouldn't worry too much about it.
- axod 16y agoAgreed. I just tested performance and the difference was moot. I'd say += is easier to read so unless you're doing something really heavy duty with strings I wouldn't worry.