Javascript examples for Array Operation:Array Convert
Convert array to string and change each element
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/* ww w. ja va2 s . c om*/ var array = ['1', '2', '3']; var ret = ""; for (var i = 0; i < array.length; i++) { ret += "\"" + array[i] + "\","; } ret = ret.substr(0, ret.length - 1); // remove last , console.log(ret); } </script> </head> <body> </body> </html>