How to returns an array as a string in JavaScript

2 Answers

0 votes
    

var arr = ["JavaScript", "PHP", "C"];
     
document.write(arr.valueOf());
     
/*
run:
     
JavaScript,PHP,C 
     
*/

 



answered Jun 7, 2015 by avibootz
0 votes
var arr = ["JavaScript", "PHP", "C"];
 
document.write(arr.toString());
 
/*
run:
 
JavaScript,PHP,C 

*/

 



answered Jun 7, 2015 by avibootz
...