tablica JavaScript do ciągów z przecinkami
var colors = ["red", "blue", "green"];
var colorsCSV = colors.join(","); //"red,blue,green"
digimax
var colors = ["red", "blue", "green"];
var colorsCSV = colors.join(","); //"red,blue,green"
// array.join(separator)
var myArray ['foo', 'bar', 'baz'];
myarray.join(':');
// foo:bar:baz
[1, 2, 3].join(""); // 123
let numbers = [0, 1, 2, 3];
let numbersToString = numbers.toString();
console.log(numbersToString);
// output is "0,1,2,3"
[1, 2, 3].join(""); // 123
var str = array.join(' '); //'apple tree'
// separator ---------^