Array Join vs String Concat

前端 未结 7 968
一向
一向 2020-11-29 03:14

Which method is faster?

Array Join:

var str_to_split = \"a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z\";
var myarray = str_to         


        
相关标签:
7条回答
  • 2020-11-29 04:04

    I can definitely say that using Array.join() is faster. I've worked on a few pieces of JavaScript code and sped up performance significantly by removing string manipulation in favor of arrays.

    0 讨论(0)
提交回复
热议问题