1['tom', 'dick', 'harry'].join(', ').replace(/, ([^,]*)$/, ' and $1')
2> "tom, dick and harry"
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