The Array.prototype.join() method:

var arr = ["Zero", "One", "Two"];

document.write(arr.join(", "));

Answer from Wayne on Stack Overflow
๐ŸŒ
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 - โ€œ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
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
jquery - Array to string containing comma's - JavaScript - Stack Overflow
Ok so I'm writing a script that includes whole sentences, but whole sentences can contain comma's. Due to the way the script works the array has to be turned into a string at least once. So when t... More on stackoverflow.com
๐ŸŒ stackoverflow.com
Convert array to string javascript by removing commas - Stack Overflow
When I try to replace "," with "", ie console.log("A = "+A.toString().replace(",", "")) , it is giving the output A = 66,.,5 ยท How do I make it so that it gives the output A=66.5 ... 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 ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
How do I convert an array to a string with commas in JavaScript
...you get a better, more thorough explanation here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join More on reddit.com
๐ŸŒ r/JavaScriptTips
1
4
April 13, 2023
๐ŸŒ
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

๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ javascript โ€บ create-a-comma-separated-list-from-an-array-in-javascript
Create a Comma Separated List from an Array in JavaScript - GeeksforGeeks
July 11, 2025 - To create a comma-separated list from an array using map() and join(), first convert each array element to a string using map(String), then join these strings into a single string separated by commas using join(','). ... The code uses map(String) ...
๐ŸŒ
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 ... // Result: 'apple, banana, orange' The join() method combines all array elements into a single string, using the provided separator between each element....
Find elsewhere
๐ŸŒ
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 - Another way to convert an array to a string in JavaScript is by using the toString() method. This method converts an array into a string, with array elements separated by commas.
๐ŸŒ
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.
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ JavaScript โ€บ Reference โ€บ Global_Objects โ€บ Array โ€บ toString
Array.prototype.toString() - JavaScript - MDN Web Docs
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]. ... const arr = ...
๐ŸŒ
Tutorial Republic
tutorialrepublic.com โ€บ faq โ€บ how-to-convert-comma-separated-string-into-an-array-in-javascript.php
How to Convert Comma Separated String into an Array in JavaScript
The following example demonstrates how to convert a comma separated string of person name into an array and retrieve the individual name using JavaScript.
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ JavaScript โ€บ Reference โ€บ Global_Objects โ€บ Array โ€บ join
Array.prototype.join() - JavaScript - MDN Web Docs
Because the string returned by Array.prototype.toString (which is the same as calling join()) does not have delimiters, nested arrays look like they are flattened. You can only control the separator of the first level, while deeper levels always use the default comma.
๐ŸŒ
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 ...
๐ŸŒ
Vultr Docs
docs.vultr.com โ€บ javascript โ€บ standard-library โ€บ Array โ€บ toString
JavaScript Array toString() - Convert Array to String | Vultr Docs
September 27, 2024 - The toString() method in JavaScript is a versatile function that converts arrays into readable, comma-separated strings. Useful for both logging and displaying array contents, it handles a variety of data types with ease.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ convert-comma-separated-string-to-array-using-javascript
JavaScript โ€“ Convert Comma Separated String To Array | GeeksforGeeks
November 26, 2024 - The process can be customized to use differen ... Making a comma-separated string from a list of strings consists of combining the elements of the list into a single string with commas between each element.
๐ŸŒ
javaspring
javaspring.net โ€บ blog โ€บ how-to-convert-array-into-comma-separated-string-in-javascript
How to Convert an Array to a Comma-Separated String in JavaScript: Quick and Easy Method โ€” javaspring.net
In JavaScript, arrays are a fundamental data structure used to store collections of values. A common task developers face is converting these arrays into comma-separated strings (e.g., for displaying lists, generating CSV data, or formatting API responses). Whether youโ€™re working with strings, numbers, or mixed data types, JavaScript provides a simple yet powerful method to achieve this: Array.prototype.join().
๐ŸŒ
OneCompiler
onecompiler.com โ€บ javascript โ€บ 3uaemw5yq
Convert Javascript string array comma separated string - JavaScript - OneCompiler
Below are couple of ways to use arrow function but it can be written in many other ways as well. ... const numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] const squaresOfEvenNumbers = numbers .filter((ele) => ele % 2 == 0) .map((ele) => ele ** 2) console.log(squaresOfEvenNumbers) ...
๐ŸŒ
daily.dev
daily.dev โ€บ home โ€บ blog โ€บ get into tech โ€บ join method javascript: faqs answered
Join Method JavaScript: FAQs Answered
December 22, 2025 - Learn how to use the join() method in JavaScript to convert arrays into strings with customizable separators and handle null values. Discover practical examples and common FAQs answered.