convert list to string javascript code example
Example 1: javascript convert in a string the items of an array
const arr = [1, 2, 'a', '1a'];
const str = arr.toString();
console.log(str);
Example 2: print whole array javascript
print whole array on one line without brackets javascript
Example 3: .join in javascript
const elements = ['Sun', 'Earth', 'Moon'];
console.log(elements.join());
console.log(elements.join(''));
console.log(elements.join('-'));
Example 4: js array join
['h', 'e', 'y'].join('')