You can use join
instead of toString
-
var myArray = [ 'zero', 'one', 'two', 'three', 'four', 'five' ]; var result = myArray.join('');
join
joins all elements of the array into a string using the argument passed to the join
function as a separator. Therefore, calling join
and passing an empty string should do exactly what you need.
Demo - http://jsfiddle.net/jAEVY/
source share