Use the join method:

alert(testarray.join("%")); // 'a%b%c'

Here's a working example. Note that by passing the empty string to join you can get the concatenation of all elements of the array:

alert(testarray.join("")); // 'abc'

Side note: it's generally considered better practice to use an array literal instead of the Array constructor when creating an array:

var testarray = ["a", "b", "c"];
Answer from James Allardice on Stack Overflow
🌐
RSWP Themes
rswpthemes.com › home › javascript tutorial › how to remove first comma from string in javascript
How to Remove First Comma from String in Javascript
December 18, 2023 - Then we use shift() to remove the first element from the array. Finally, we join the array back into a string using join(','), effectively removing the first comma.
Discussions

javascript - Remove leading comma from a string - Stack Overflow
I have the following string: ",'first string','more','even more'" I want to transform this into an Array but obviously this is not valid due to the first comma. How can I remove the first comma fr... More on stackoverflow.com
🌐 stackoverflow.com
javascript - remove first comma of string from arry - Stack Overflow
Thanks in advance for your response, I'm checking a ddbb to bring the names of some items and paint them in my ts like this: app-batch-app-management.ts import { Component, OnInit } from '@angular... More on stackoverflow.com
🌐 stackoverflow.com
Remove comma from javascript array - Stack Overflow
Hi all I am framing a url with Query string in javascript as follows every thing works fine but a comm is coming in between the query string so can some one help me More on stackoverflow.com
🌐 stackoverflow.com
javascript - Remove text before first comma - Stack Overflow
The procedure is simple. Just first split the string with comma(,) and it returns an array. Then splice the first index of the array by arr.splice(0,1), Here 0 is the index number and 1 for how many elements you want to remove. More on stackoverflow.com
🌐 stackoverflow.com
December 5, 2018
🌐
Reddit
reddit.com › r/learnjavascript › remove comma from an array
r/learnjavascript on Reddit: Remove Comma from an Array
January 21, 2022 -

I created a div element and appended an array into it. However, when the array is printed, it shows the commas as well. Is there a way to remove the commas when printing the array? (Please ignore the really weird choice of words, I just placed random words in the array to test something).

Input Output
🌐
Java2Blog
java2blog.com › home › core java › remove comma from string in javascript
Remove Comma from String in JavaScript - Java2Blog
May 24, 2022 - Then joined the array elements with empty String using join() method. That’s all about how to remove comma from string in Javascript.
🌐
EncodedNA
encodedna.com › javascript › how-to-remove-commas-from-array-in-javascript.htm
How to Remove Commas from Array in JavaScript
You can use the join() method in JavaScript to remove commas from an array. The comma delimiter in an array works as the separator.
🌐
Quora
quora.com › How-do-I-remove-commas-while-displaying-an-array-in-JavaScript
How to remove commas while displaying an array in JavaScript - Quora
Answer (1 of 5): * By default the [code ].toString()[/code] of an [code ]Array[/code] will use comma as its delimiter. To display them next to each other * Use join Method * The [code ]join()[/code] method joins all elements of an array (or an array-like object) into a string and returns this...
🌐
The Web Dev
thewebdev.info › home › how to remove a leading comma from a javascript string?
How to Remove a Leading Comma from a JavaScript String? - The Web Dev
April 23, 2021 - Then we use the rest operator to get a string array with anything but the first comma. And then we call join with ',' to join the strings in rest with the comma. And so newString has the same value as before. Another way to remove the leading commas from a string is to use the JavaScript string’s replace method.
🌐
LinkedIn
linkedin.com › pulse › how-remove-comma-from-string-javascript-vkaif
How to remove comma from string in JavaScript
March 19, 2024 - ... Another approach to remove commas from a string is by splitting the string into an array based on the comma delimiter and then joining the array elements back into a string without commas.
Find elsewhere
🌐
Stack Overflow
stackoverflow.com › questions › 62514170 › remove-first-comma-of-string-from-arry
javascript - remove first comma of string from arry - Stack Overflow
1 how to remove comma from innerHtml, value coming from JSON in angular 4 ? image attached · 3 How to trim spaces between word, and after comma using javascript · 1 Separate the value from array that is coming as one but seperated by comma · 0 Create new array for each value separated by comma in a string ·
🌐
javaspring
javaspring.net › blog › replace-string-in-javascript-array
How to Remove Commas from Strings in a JavaScript Array: A Step-by-Step Guide — javaspring.net
Use array.map() to loop through each string in the array. For each string, use replace(/,/g, ' ') to remove all commas (the g flag ensures all commas are removed, not just the first).
🌐
Delft Stack
delftstack.com › home › howto › javascript › remove commas from string javascript
How to Remove Commas From String in JavaScript | Delft Stack
February 2, 2024 - Once the array elements are a string, you can use the parseFloat() function on it before adding them. let first_string = '12,222,526.99'; let second_string = '2,821.21'; let replaced_first_string = first_string.split(',').join(''); let ...
🌐
Medium
frontendinterviewquestions.medium.com › how-to-remove-comma-from-string-in-javascript-0b5cc90fd65f
How to remove comma from string in JavaScript | by Pravin M | Medium
April 15, 2024 - ... Another approach to remove commas from a string is by splitting the string into an array based on the comma delimiter and then joining the array elements back into a string without commas.
🌐
xjavascript
xjavascript.com › blog › removing-commas-from-javascript-array
How to Remove Commas from a JavaScript Array and Replace with Custom Characters (e.g., %, %$) — xjavascript.com
Working with arrays is a fundamental part of JavaScript development, whether you’re building web apps, processing data, or formatting output. A common scenario arises when converting arrays to strings: by default, JavaScript joins array elements with commas (e.g., `[1, 2, 3]` becomes `"1,2,3"`). While commas are useful in many cases, there are times you need to replace them with custom characters—such as `%`, `%$`, hyphens, or even spaces.