Prev Demo
JavaScript
>
Array To String
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <p>Converting an array elements to a string.</p> <input type="button" onclick="myValue()" value="Return"/> <p id="myId"></p> <script> function myValue() { var a = ["India", "Mumbai", "Pakisthan", "Karachi", "Malaysia", "Abudhabi"]; var b = a.toString(); document.getElementById("myId").innerHTML = b; } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output