Test case details

Preparation Code

<script>   var arr = ['a', 'b', 'c', 'd'] </script>

Test cases

Test #1

var foo = 'a' + 'b' + 'c' + 'd';

Test #2

var foo = 'a'; foo += 'b'; foo += 'c'; foo += 'd';

Test #3

var foo = 'a'; foo = foo + 'b'; foo = foo + 'c'; foo = foo + 'd';

Test #4

var foo = arr.join('');

Test #5

var foo = 'a'; foo += 'b' + 'c' + 'd';

Test #6

function concat(arr) {   len = arr.length;   for (s = "", i = 0; i < len; s += arr[i], i++);   return s; } var foo = concat(arr);

Test #7

var foo = 'a' + 'b' + 'c' + 'd' + 'e';

Test #8

var foo = 'abcd';