I have a array of strings:
str[1]='apple';
str[2]='orange';
str[3]='banana';
//...many of these items
Then, I would like to construct a string variable which looks like var mystr='apple,orange,banana,...', I tried the following way:
var mystr='';
for(var i=0; i<str.length; i++){
mystr=mystr+","+str[i];
}
Which is of course not what I want, is there any efficient way to connect all this str[i] with comma?