Simply like that:
arr.join("")
Answer from VisioN on Stack OverflowSimply like that:
arr.join("")
You can specify an empty string as an argument to join, if no argument is specified a comma is used.
arr.join('');
http://jsfiddle.net/mowglisanu/CVr25/1/
How to convert array into string without comma and separated by space in javascript without concatenation? - Stack Overflow
Convert array to string javascript by removing commas - Stack Overflow
How do I convert an array to a string with commas in JavaScript
Why does my Numpy array not have any commas? Is that wrong?
The commas are not "missing", that's just how Numpy arrays are displayed. The representation of the data inside your computer does not use or need commas, they are simply there for display.
More on reddit.comWhen you call join without any argument being passed, ,(comma) is taken as default and toString internally calls join without any argument being passed.
So, pass your own separator.
var str = array.join(' '); //'apple tree'
// separator ---------^
MDN on Array.join
pass a delimiter in to join.
['apple', 'tree'].join(' '); // 'apple tree'
You can simple use the Array.prototype.join function
const A = [ '6', '6', '.', '5' ];
console.log(A.join(''));
As explain on the Documentation page of Array.prototype.join
The join() method creates and returns a new string by concatenating all of the elements in an array (or an array-like object), separated by commas or a specified separator string. If the array has only one item, then that item will be returned without using the separator.
It can take as parameter the separator which will be use to separate element from the array when they are joined.
let list = ["a", "b", "c", "d"];
list.join("-"); // will return "a-b-c-d"
list.join("/"); // will return "a/b/c/d"
list.join(""); // will return "abcd"
By default the separator is ,. This means if you don't specify which character will be use as the separator it will use the , character
list.join(); // will return a,b,c,d
console.log(['6', '6', '.', '5'].join(''));