The “join” method in JavaScript is used on Arrays irrespective of the datatype of each element of the array. Just like the name of the method suggests, the array’s elements will be joined together. The result of the join is a string with a comma(,) as the separator for the elements by default. For example;

var electronics = ["television", "computer", "printer"]

When Array.join() is called on our array as shown below;


we get;


Another way of using the join method is by giving it a separator. In this case, the elements will be joined using the separator given…

Pollet Obuya

Software Engineer Elixir | Learner

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store