javascript array to comma separated string

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

Also in JavaScript: