The method array.toString() actually calls array.join() which result in a string concatenated by commas. ref

var array = ['a','b','c','d','e','f'];
document.write(array.toString()); // "a,b,c,d,e,f"

Also, you can implicitly call Array.toString() by making javascript coerce the Array to an string, like:

//will implicitly call array.toString()
str = ""+array;
str = `${array}`;

Array.prototype.join()

The join() method joins all elements of an array into a string.

Arguments:

It accepts a separator as argument, but the default is already a comma ,

str = arr.join([separator = ','])

Examples:

var array = ['A', 'B', 'C'];
var myVar1 = array.join();      // 'A,B,C'
var myVar2 = array.join(', ');  // 'A, B, C'
var myVar3 = array.join(' + '); // 'A + B + C'
var myVar4 = array.join('');    // 'ABC'

Note:

If any element of the array is undefined or null , it is treated as an empty string.

Browser support:

It is available pretty much everywhere today, since IE 5.5 (1999~2000).

References

  • ECMA Specification
  • Mozilla
  • MSDN
Answer from Victor on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Array › join
Array.prototype.join() - JavaScript | MDN - Mozilla
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.
🌐
W3Schools
w3schools.com › jsref › jsref_join.asp
JavaScript Array join() Method
The join() method returns an array as a string. The join() method does not change the original array. Any separator can be specified. The default is comma (,). array.join(separator) Array Tutorial · Array Const · Basic Array Methods · Array ...
Discussions

How to convert array into comma separated string in javascript - Stack Overflow
I have an array: a.value = [a,b,c,d,e,f] How can I convert to comma-seperated string like: a.value = "a,b,c,d,e,f" More on stackoverflow.com
🌐 stackoverflow.com
Turn Array Into String, Separate String With Separator - JavaScript - Stack Overflow
Define a function, myJoin, that accepts up to two arguments: array separator (string, optional) myJoin should return a string with all of the elements from the array joined together. The separator ... More on stackoverflow.com
🌐 stackoverflow.com
Easy way to turn JavaScript array into comma-separated list? - Stack Overflow
See similar questions with these tags. ... New site design and philosophy for Stack Overflow: Starting February 24, 2026... ... I’m Jody, the Chief Product and Technology Officer at Stack Overflow, let’s... 190 How to convert array into comma separated string in javascript More on stackoverflow.com
🌐 stackoverflow.com
jquery - Transform Javascript Array into delimited String - Stack Overflow
and I want to turn it into a pipe delimited string like this: A12|B50|C105... How could I do this? I'm using jQuery (in case that helps with some kind of builtin function). ... Array.join is a native Array method in Javascript which turns an array into a string, joined by the specified separator ... More on stackoverflow.com
🌐 stackoverflow.com
October 27, 2022
🌐
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

🌐
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 - Use the join() method to convert an array into a string with custom separators in JavaScript efficiently.
🌐
daily.dev
daily.dev › home › blog › get into tech › join method javascript: faqs answered
Join Method JavaScript: FAQs Answered
December 22, 2025 - The join() method in JavaScript is an essential tool for converting arrays into strings. This method allows you to specify a separator for the items in the array, defaulting to a comma if none is provided.
🌐
CodingNomads
codingnomads.com › javascript-array-to-string-conversion
JavaScript Array-String Conversion
The .join() Array method is used to convert an array to a string. It takes an optional separator argument, which is used to separate the array elements in the string. If no separator is specified, the array elements are separated with a comma.
Find elsewhere
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › String › split
String.prototype.split() - JavaScript | MDN - Mozilla
All values that are not undefined or objects with a [Symbol.split]() method are coerced to strings. ... A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified separator, but stops ...
🌐
ReqBin
reqbin.com › code › javascript › ot8wzla9 › javascript-array-to-string-example
How do I convert array to string in JavaScript?
If you need to convert an array to a string with a specific separator, use the Array.join(separator) method. In this JavaScript Array to String example, we use the Array.toString() method to convert an array with elements to a string.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Array › toString
Array.prototype.toString() - JavaScript - MDN - Mozilla
The toString method of arrays calls join() internally, which joins the array and returns one string containing each array element separated by commas. If the join method is unavailable or is not a function, Object.prototype.toString is used instead, returning [object Array]. js · const arr ...
🌐
Bobby Hadz
bobbyhadz.com › blog › javascript-convert-array-to-comma-separated-string
Convert Array to String (with and without Commas) in JS | bobbyhadz
The Array.join() method will return a string where all of the array elements are joined with a comma separator.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › convert-array-to-string-in-javascript
Convert Array to String in JavaScript - GeeksforGeeks
July 23, 2025 - The String() method converts the array elements to string and then concatenates them with commas as a separator.
🌐
Medium
medium.com › coding-at-dawn › how-to-convert-an-array-to-a-string-with-commas-in-javascript-79e212506c2
How to Convert an Array to a String with Commas in JavaScript | by Dr. Derek Austin 🥳 | Coding at Dawn | Medium
January 5, 2023 - One of JavaScript’s most helpful built-in array methods is .join() (Array.prototype.join()), which returns a string primitive. “The join() method creates and returns a new string by concatenating all of the elements in an array (or an array-like object), separated by commas or a specified separator string.” — MDN Docs
🌐
Altcademy
altcademy.com › blog › how-to-convert-array-to-string-in-javascript
How to convert array to string in JavaScript - Altcademy.com
August 29, 2023 - In this example, the string ' and ' is used as the separator, replacing the default comma. There may be times where you do not want any separators between your array elements when converting to a string. The join() function can handle this too!
🌐
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 ... If you want to join your array with something different than commas, you can pass the separator of your choice....
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-array-join-method
JavaScript Array join() Method - GeeksforGeeks
January 16, 2026 - The JavaScript join() method is used to combine all elements of an array into a single string. The elements are separated by a specified separator, with a comma (,) as the default.
🌐
Tutorial Reference
tutorialreference.com › javascript › examples › faq › javascript-how-to-convert-array-to-comma-separated-string
How to Convert an Array to a Comma-Separated String in JavaScript | Tutorial Reference
Using join(',') directly is the recommended best practice because it clearly communicates your intent and allows you to easily change the separator if needed. For converting an array to a delimited string, the Array.prototype.join() method is the standard, most effective tool in JavaScript.