Can I implode an array in jQuery like in PHP?
We can create alternative of implode of in javascript:
function my_implode_js(separator,array){
var temp = '';
for(var i=0;i<array.length;i++){
temp += array[i]
if(i!=array.length-1){
temp += separator ;
}
}//end of the for loop
return temp;
}//end of the function
var array = new Array("One", "Two", "Three");
var str = my_implode_js('-',array);
alert(str);