Prev Demo
JavaScript
>
Array Join
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <p>Click the below button to to join the elements of an array into a string.</p> <input type="button" onclick="myValue()" value="Join"/> <p id="myId"></p> <script> function myValue() { var a = ["France", "Egypt", "Darziling", "China", "Bangladesh", "Abudhabi"]; var b = a.join(); document.getElementById("myId").innerHTML = b; } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output