I have an array
var arr = ["one","two","three","four"];
Is it possible to convert it like this through some regexes
"one","two","three","four"
the resultant should not be an entire string rather it is comma separated strings.
Any suggestions ???
function func(){
var arr = ["one","two","three","four"];
var result = "";
for (var i = 0; i <= arr.length - 1; i++) {
result += '"' + arr[i] + '",';
}
result = result.substring(0, result.length - 1);
alert(result);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With