Which is faster?
var str = '';
for(var i=0; i<1000; i++) {
str += i;
}
or
var arr = [];
for(var i=0; i<1000; i++) {
arr.push(i);
}
var str = arr.join('');
I ask because I have written a CSS parser which works really well, but is very slow for larger stylesheets (understandably). I am trying to find ways of making it faster, I wondered if this would make a difference. Thanks in advance!