JavaScript connects all the elements of an array by the join function

  • 2020-05-17 04:50:37
  • OfStack

This example shows how JavaScript connects all the elements of an array through the join function. Share with you for your reference. The specific implementation method is as follows:


<script type="text/javascript">
var days = ["Sunday","Monday","Tuesday","Wednesday",
  "Thursday","Friday","Saturday"];
document.write("days:"+days.join(","));
</script>

The output results are as follows:
days:Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday

I hope this article has been helpful to your javascript programming.


Related articles: