turn an array into a string code example

Example 1: js array to string

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

Example 2: javascript convert in a string the items of an array

const arr = [1, 2, 'a', '1a'];
const str = arr.toString();
console.log(str); //> "1,2,a,1a"

Example 3: print whole array javascript

print whole array on one line without brackets javascript

Example 4: array to string java

char[] charArray = new char[] {'b','u','z','z'};

String answer = new String(charArray);

Example 5: array to string javascript

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

Example 6: turn array into string

const elements = ['Fire', 'Air', 'Water'];

console.log(elements.join());
// expected output: "Fire,Air,Water"

console.log(elements.join(''));
// expected output: "FireAirWater"

console.log(elements.join('-'));
// expected output: "Fire-Air-Water"