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
๐ŸŒ
SPGuides
spguides.com โ€บ typescript-array-to-string-with-separator
How to Convert Typescript Array to String With Separator? โ€“ Learn SharePoint, Microsoft Power Platform and SPFx Tutorials โ€“ SPGuides
July 21, 2025 - Check out Format Numbers with Commas in TypeScript ยท Here we will see how to convert an array to a string with a separator, using reduce() in TypeScript.
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ typescript โ€บ typescript_array_join.htm
TypeScript - Array join()
join() method joins all the elements of an array into a string. separator โˆ’ Specifies a string to separate each element of the array. If omitted, the array elements are separated with a comma.
๐ŸŒ
YouTube
youtube.com โ€บ tsinfo technologies
Convert Array to String using separator in TypeScript | TypeScript Programming | TypeScript Tutorial - YouTube
I will show you how to convert an array to a string using Typescript methods in this TypeScript video tutorial. By using the below methods:1. Using Join()2. ...
Published: October 6, 2023
Views: 42
๐ŸŒ
xjavascript
xjavascript.com โ€บ blog โ€บ typescript-array-to-string-with-separator
TypeScript Array to String with Separator: A Comprehensive Guide โ€” xjavascript.com
The process of converting an array ... placed between each element. In JavaScript (and thus TypeScript), the join() method is used for this purpose....
๐ŸŒ
Webdevtutor
webdevtutor.net โ€บ blog โ€บ typescript-array-to-string-separator
Converting TypeScript Array to String with Separator
const array: string[] = ["apple", ... | banana | orange" Converting a TypeScript array to a string with a separator can be done efficiently using methods like join and reduce....
๐ŸŒ
Webdevtutor
webdevtutor.net โ€บ blog โ€บ typescript-array-of-objects-to-string-with-separator
Converting TypeScript Array of Objects to String with Separator
interface Person { name: string; ... snippet, we define an array of Person objects and specify a separator as ', '. We then use the map() method to transform each object into a formatted string and finally join these strings using the specified separator....
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ JavaScript โ€บ Reference โ€บ Global_Objects โ€บ Array โ€บ join
Array.prototype.join() - JavaScript - MDN Web Docs
The join() method of Array instances returns a new string that is the concatenation of all elements in this array, separated by commas or a specified separator string. If the array has only one item, that item's stringification is returned without using the separator.
Find elsewhere
๐ŸŒ
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 โ€บ typescript-array-join-method
TypeScript Array join() Method - GeeksforGeeks
July 12, 2024 - The Array.join() method in TypeScript is a built-in function used to join all the elements of an array into a single string. This method is particularly useful when you need to concatenate array elements with a specific 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 - When you want just the comma character (,) to appear as the separator between items in the list, use .join(",") to convert the array to a string. ... AI-Native Senior Full-Stack SWE ยท UI/UX Engineer ยท TypeScript ...
๐ŸŒ
Webdevtutor
webdevtutor.net โ€บ blog โ€บ typescript-list-to-string-with-separator
Converting TypeScript List to String with Separator | Helpful Coding Tips
One of the simplest and most effective ways to convert a list to a string with a separator in TypeScript is by using the join method. The join method concatenates all the elements of an array into a string, with an optional separator between each element.
๐ŸŒ
daily.dev
daily.dev โ€บ home โ€บ blog โ€บ webdev โ€บ join method javascript: faqs answered
Join Method JavaScript: FAQs Answered | daily.dev
May 25, 2026 - This means it looks inside each nested array and joins those elements too. So, join() goes through your list, puts your chosen separator between items, and makes one big string out of it. It's a straightforward tool in JavaScript for making lists easier to work with.
๐ŸŒ
Educative
educative.io โ€บ answers โ€บ what-is-the-join-method-of-an-array-in-typescript
What is the join() method of an array in TypeScript?
The join() method in TypeScript is used to join the elements of an array as a string. ... separator: This is a character or string that separates each element of the array when joined as a string.
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ typescript โ€บ typescript_string_split.htm
TypeScript - String split()
If separator is omitted, the array returned contains one element consisting of the entire string. limit โˆ’ Integer specifying a limit on the number of splits to be found. The split method returns the new array. Also, when the string is empty, split returns an array containing one empty string, rather than an empty array.
๐ŸŒ
Webdevtutor
webdevtutor.net โ€บ blog โ€บ typescript-array-into-string
Converting TypeScript Array into String: A Comprehensive Guide
One of the simplest and most effective ways to convert an array into a string in TypeScript is by using the join() method. This method concatenates all the elements of an array into a single string, with an optional separator between each element.
๐ŸŒ
ReqBin
reqbin.com โ€บ code โ€บ javascript โ€บ ot8wzla9 โ€บ javascript-array-to-string-example
How do I convert array to string in JavaScript?
November 21, 2023 - To convert an array to a string using a separator between elements in JavaScript, you can use the array.join(separator) method:
๐ŸŒ
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 join() function takes the fruits array and converts it into a string. Note that each array element is separated by a comma.