javascript array to comma separated list

JavaScript
//comma separated string into array
var colorsString="red,green,blue";
var colorsArray=colorsString.split(","); //split colorsString into array;
//console.log(colorsArray); ["red", "green", "blue"]var colors = ["red", "blue", "green"];
var colorsCSV = colors.join(","); //"red,blue,green"
Source

Also in JavaScript: