Organizational Research By

Surprising Reserch Topic

why is string concatenation faster than array join


why is string concatenation faster than array join  using -'javascript,performance,string-concatenation'

Today, I read this thread about speed of string concatenation.

Surprisingly, string concatenation was the winner:


  http://jsperf.com/array-join-vs-string-connect
  
  http://jsperf.com/join-concat/2


The result was opposite from what I thought. Besides, there are many articles about this which explains oppositely like this or this.

I can guess that browsers are optimized to string concat on latest version, but how do they do that? Can we say that it is better to use + when concatenating strings?
    

asked Oct 13, 2015 by girisha
0 votes
2 views



Related Hot Questions

6 Answers

0 votes
NULL
answered Oct 13, 2015 by mannar kande
0 votes
NULL
answered Oct 13, 2015 by gauravsinghal83
0 votes
NULL
answered Oct 13, 2015 by ankitarajoria4
0 votes
NULL
answered Oct 13, 2015 by jekbishnoi
0 votes
NULL
answered Oct 13, 2015 by vibhorsingh
0 votes
NULL
answered Oct 13, 2015 by balvant maurya

...