mdn array join code example
Example 1: javascript join array
var array = ["Joe", "Kevin", "Peter"];
array.join();
array.join("-");
array.join("");
array.join(". ");
Example 2: join javascript array
const cities = ['London', 'Paris', 'Tokyo'];
const joinedCities = cities.join('-');
console.log(joinedCities);
Example 3: .join in javascript
const elements = ['Sun', 'Earth', 'Moon'];
console.log(elements.join());
console.log(elements.join(''));
console.log(elements.join('-'));
Example 4: join in array
var a = ['Wind', 'Water', 'Fire'];
a.join();
a.join(', ');
a.join(' + ');
a.join('');
Example 5: js array join
['h', 'e', 'y'].join('')