I’m sure you’ve all seen code like this in JS:
var args = 'now later today tomorrow'.split(' ')
Anyone know why that’s faster than this:
args = ['now', 'later', 'today', 'tomorrow']
(I don’t know the answer to this, but I can verify by timing in the console that splitting is faster)
I Would be surprised if it was faster, could you post how you came to think it is?
I made this perf quickly and It shows its not faster.
http://jsperf.com/split-performance