For a long time, I have assumed that joining strings ([line1, line2].join('')
), was faster than concatenating (line1 + line2
).
Suddenly it hit me, that I actually didn't know if it was true.
So I created this test, which basically CRUSHES that assumption!
This is apparently an old fact, that has just stuck with me.
According to Craig Buckler the assumption is valid in IE7! So if you are writing code for IE7, keep telling yourself to join ;-)