JavaScript join() Function Example - Join two array

JavaScript join() Function join two array string.

Example

<html>
<head>
    <title>JavaScript Array join() function</title>
</head>
<body>
    <script type="text/javascript">
        var city = ["Ahmedabad", "Toranto", "Mumbai", "Londan"];
        document.write(city.join(" or ") + "<br />");
        document.write(city.join(" and ") + "<br />");
    </script>
</body>
</html>

Run it...   »

Example Result