Posted By

micmath on 05/02/08


Tagged


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

vickyvamp
ischenkodv


Faster concat


 / Published in: JavaScript
 

The plus operator is sometimes slower than joining an array.

  1. String.concat = function() {
  2. var args = Array.prototype.slice.call(arguments);
  3. return args.join("");
  4. }
  5.  
  6. alert(String.concat("a", "b", "c"));

Report this snippet  

You need to login to post a comment.