1var colors = ["red", "blue", "green"];
2var colorsCSV = colors.join(","); //"red,blue,green"
1var colors = ["red", "blue", "green"];
2var colorsString = colors.join(","); //"red,blue,green"
1const arr = [1, 2, 'a', '1a'];
2const str = arr.toString();
3console.log(str); //> "1,2,a,1a"
1var cars = ["Volvo", "BMW", "Audi", "Chevrolet"];
2console.log(cars.toString());
3//Output: Volvo,BMW,Audi,Chevrolet
1const cities = ['London', 'Paris', 'Tokyo'];
2const joinedCities = cities.join();
3
4console.log(joinedCities); // London,Paris,Tokyo
5