convert array into string javascript code example

Example 1: js array to string

var myArray = ['no','u'];
var myString = myArray.toString();

Example 2: array to string javascript

<array>.join(<splitting character(s)>);

Example 3: javascript join address to string

var address = "foo";
var city;
var state = "bar";
var zip;

text = [address, city, state, zip].filter(Boolean).join(", ");
console.log(text)

Example 4: join in array

var a = ['Wind', 'Water', 'Fire'];
a.join();      // 'Wind,Water,Fire'
a.join(', ');  // 'Wind, Water, Fire'
a.join(' + '); // 'Wind + Water + Fire'
a.join('');    // 'WindWaterFire'