Javascript examples for Array:toString
The toString() method converts an array into a String and returns the result.
None
A String, representing the values of the array, separated by a comma
The following code shows how to Convert an array to a string:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {//from w w w .j a va 2 s. co m var fruits = ["a","b","c","d","e"]; fruits.toString(); document.getElementById("demo").innerHTML = fruits; } </script> </body> </html>