I have this code in JS:
var array = ['one', 'two'];
And each time I want to display the array, it is displayed with like this:
one,two
Now my question is, is there any way to remove that nasty comma?
I have this code in JS:
var array = ['one', 'two'];
And each time I want to display the array, it is displayed with like this:
one,two
Now my question is, is there any way to remove that nasty comma?
To display them next to each other, you can use join. array.join(' ');
['one', 'two', 'three'].join(' SHIZZAM! '); will give you one SHIZZAM! two SHIZZAM! threeYou could use the replace method of the string object:
array.toString().replace(',',' ')
join().