I used gSkinners PerformaceTest to perform a quick test. I think the difference is minimal at best. I would say that replace() would be the preferred option, because that is what you want to achieve. Using split().join() not so clear in its intent.
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– Using replace() (10000 iterations) –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– method...................................................ttl ms...avg ms [function] 57 0.01 –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– Using split().join() (10000 iterations) –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– method...................................................ttl ms...avg ms [function] 61 0.01 ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
source share