matriz de javascript a la cadena CSV
var colors = ["red", "blue", "green"];
var colorsString = colors.join(","); //"red,blue,green"
Friendly Hawk
var colors = ["red", "blue", "green"];
var colorsString = colors.join(","); //"red,blue,green"
var colors = ["red", "blue", "green"];
var colorsCSV = colors.join(","); //"red,blue,green"
array.join("").toString()
const arr = [1, 2, 'a', '1a'];
const str = arr.toString();
console.log(str); //> "1,2,a,1a"
var cars = ["Volvo", "BMW", "Audi", "Chevrolet"];
console.log(cars.toString());
//Output: Volvo,BMW,Audi,Chevrolet
const selectedPlaces=[
{ name: 'Stockholm', isChecked: true },
{ name: 'Dubai', isChecked: true },
{ name: 'San Francisco', isChecked: 'false' },
]
const tempSelectedPlace = selectedPlaces.filter(place => place.isChecked === true);
//[{ name: 'Stockholm', isChecked: true },{ name: 'Dubai', isChecked: true },]
const selectedPlace = tempSelectedPlace.map(place => place.name).join(', ')
console.log(selectedPlace)
//Stockholm,Dubai