javascript中字符串连接时用Array.join()替换 string += "xx",换来几十倍的速度提升
将50000个字符串连接起来,
直接用+=连接耗时17547毫秒,
使用Array.join()耗时234毫秒,比前者快了近75倍!
javascript中字符串连接时用Array.join()替换 string += "xx",换来几十倍的速度提升
将50000个字符串连接起来,
直接用+=连接耗时17547毫秒,
使用Array.join()耗时234毫秒,比前者快了近75倍!