🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Array › join
Array.prototype.join() - JavaScript | MDN
The join() method of Array instances creates and returns a new string by concatenating all of the elements in this array, separated by commas or a specified separator string. If the array has only one item, then that item will be returned without using the separator.
🌐
DEV Community
dev.to › gaelgthomas › array-to-string-without-commas-in-javascript-4mg6
Array to String Without Commas in JavaScript - DEV Community
September 18, 2022 - with parameter: your array will be joined with the string provided as a parameter (["hello", "world"].join("-")) ... const helloMagicWorldArray = ["Hello", "Magic", "World"] const helloMagicWorldString = helloMagicWorldArray.join("") console.log(helloMagicWorldString) // Output: "HelloMagicWorld" I suppose you start the get the idea! If you want to join your array with something different than commas, you can pass the separator of your choice.
🌐
CodingNomads
codingnomads.com › javascript-array-to-string-conversion
JavaScript Array-String Conversion
The .toString() method is not very flexible, but it's a quick way to convert an array to a string if you don't need to customize the separator.
🌐
Medium
medium.com › @gaelgthomas › array-to-string-without-commas-in-javascript-d4e6ebcbf3e2
Array to String Without Commas in JavaScript | by Gaël Thomas | Medium
September 18, 2022 - with parameter: your array will be joined with the string provided as a parameter (["hello", "world"].join("-")) ... const helloMagicWorldArray = ["Hello", "Magic", "World"]const helloMagicWorldString = helloMagicWorldArray.join("")console.log(helloMagicWorldString) // Output: "HelloMagicWorld" I suppose you start the get the idea! If you want to join your array with something different than commas, you can pass the separator of your choice.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › convert-array-to-string-in-javascript
Convert Array to String in JavaScript - GeeksforGeeks
July 23, 2025 - In JavaScript, converting an array to a string involves combining its elements into a single text output, often separated by a specified delimiter. This is useful for displaying array contents in a readable format or when storing data as a single string.
🌐
Altcademy
altcademy.com › blog › how-to-convert-array-to-string-in-javascript
How to convert array to string in JavaScript
August 29, 2023 - ... let fruits = ['apple', 'banana', 'cherry']; let fruitsString = fruits.toString(); console.log(fruitsString); // 'apple,banana,cherry' This code works similarly to the join() method without a custom separator.
🌐
CoreUI
coreui.io › answers › how-to-convert-an-array-to-a-string-in-javascript
How to convert an array to a string in JavaScript · CoreUI
September 23, 2025 - If no separator is provided, join() defaults to using commas. The method works with any array content and automatically converts non-string elements to strings during the process.
Find elsewhere
🌐
W3Schools
w3schools.com › jsref › jsref_join.asp
JavaScript Array join() Method
cssText getPropertyPriority() ... "Apple", "Mango"]; let text = fruits.join(" and "); Try it Yourself » · The join() method returns an array as a string....
🌐
Reddit
reddit.com › r/javascripttips › how do i convert an array to a string with commas in javascript
r/JavaScriptTips on Reddit: How do I convert an array to a string with commas in JavaScript
April 13, 2023 -

In JavaScript, you can convert an array to a string with commas using the join()
method.

The join() method returns a string that concatenates all the elements of an array, separated by the specified separator, which in this case is a comma.

Here is an example:

const array = ['apple', 'banana', 'orange'];
const string = array.join(', ');
console.log(string); 

// output: "apple, banana, orange"

In this example, we first define an array of three fruits. Then we use the join()
method with a comma and a space as the separator to create a string that lists all the fruits with a comma and a space between each one.

You can replace the comma and space separator with any other separator you like, such as a hyphen, a semicolon, or a newline character.

It's important to note that the join() method only works on arrays, and it will throw an error if you try to use it on any other type of object.

Click here to learn more ways to Convert Array to String with Commas in JS

🌐
ReqBin
reqbin.com › code › javascript › 98ugueow › javascript-array-join-example
How do I join array elements in JavaScript?
separator (optional): the separator to be used when concatenating elements in a string value. If an empty string is passed as a method parameter, the array elements will be joined into one string without using a separator.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › String › split
String.prototype.split() - JavaScript | MDN
The capturing groups may be unmatched, in which case they are undefined in the array. If separator has a custom [Symbol.split]() method, its return value is directly returned. If separator is a non-empty string, the target string is split by all matches of the separator without including separator in the results.