from array to string js code example
Example 1: join last element of array javascript with different value
['tom', 'dick', 'harry'].join(', ').replace(/, ([^,]*)$/, ' and $1')
> "tom, dick and harry"
Example 2: js array to string
var myArray = ['no','u'];
var myString = myArray.toString();
Example 3: javascript convert in a string the items of an array
const arr = [1, 2, 'a', '1a'];
const str = arr.toString();
console.log(str);
Example 4: array to string js
array.join("").toString()
Example 5: transform array to string js
const myArray = [1, 2, 3, 4, 5, 6];
console.log(a.join('/'));
const myArray = ['g', 'o', 'o', 'g', 'l', 'e'];
console.log(a.join(''));
const array1 = [1, 2, 'a', '1a'];
console.log(array1.toString());
Example 6: array to string javascript
<array>.join(<splitting character(s)>);