Simply like that:
arr.join("")
Answer from VisioN on Stack Overflowjavascript - using .join method to convert array to string without commas - Stack Overflow
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
[javascript] how to effectively convert string to array while removing commas and the space at the beginning/end if there was any?
When 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(''));