If value is not a plain array, such code will work fine:

var value = { "aaa": "111", "bbb": "222", "ccc": "333" };
var blkstr = [];
$.each(value, function(idx2,val2) {                    
  var str = idx2 + ":" + val2;
  blkstr.push(str);
});
console.log(blkstr.join(", "));
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>

(output will appear in the dev console)

As Felix mentioned, each() is just iterating the array, nothing more.

Answer from user447356 on Stack Overflow
🌐
W3Schools
w3schools.com › jsref › jsref_tostring_array.asp
JavaScript Array toString() Method
The toString() method returns a string with array values separated by commas.
Discussions

jquery - Convert javascript array to string - Stack Overflow
JSON.stringify also makes a single value look like a proper array and not a string: [8] vs 8. That would be the top answer if I had all the votes. Thanks for mentioning it. 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
Converting an Array to a String in JavaScript - General Questions/Help - Devtalk
I have an array of strings in JavaScript, and I need to convert it into a single string with specific delimiter characters between the elements. Here’s a sample array: let myArray = ["apple", "banana", "cherry", "date"]… More on forum.devtalk.com
🌐 forum.devtalk.com
2
September 22, 2023
[Javascript] Adding a string to an array?
I'm no JavaScript expert, but it seems to me that if you use += on an array, you end up with a string: From my browsers dev tools console: Imgur I'm not sure of the underlying mechanism here (hopefully someone will be along to educate me ...) but it seems obvious from this that you can't use += to add to an array, which is why your code doesn't work. Use push instead. Even in C# you can't use += to add to an array, so I don't know why you think it might work in JavaScript. EDIT: and in your code, word should be a string, not an array, surely, and so you can use += to ad each letter to the end of word. It's only words that needs to be an array and to use push. More on reddit.com
🌐 r/learnprogramming
10
2
October 16, 2020
🌐
ReqBin
reqbin.com › code › javascript › ot8wzla9 › javascript-array-to-string-example
How do I convert array to string in JavaScript?
November 21, 2023 - You can also create a multiline string, check if it starts or ends with another string, and get the length of a string. In JavaScript, you can convert an array to a string using the Array.join(separator) and array.toString() methods.
🌐
CodingNomads
codingnomads.com › javascript-array-to-string-conversion
JavaScript Array-String Conversion
Learn how to seamlessly convert between arrays and strings in JavaScript using methods like .join(), .split(), and more.
🌐
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.
🌐
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

Find elsewhere
🌐
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 - In JavaScript, all arrays have a built-in method called join(). You can use it to convert an array to a string without commas. You can call the join method with an empty string as a parameter (join("")).
🌐
Tabnine
tabnine.com › home › array to string in javascript
Array to String in JavaScript - Tabnine
July 25, 2024 - JavaScript’s toString() method operates on a given object, returning its text representation as a string. Applying the toString() method to an array returns the values in the array as a string.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › convert-array-to-string-in-javascript
Convert Array to String in JavaScript - GeeksforGeeks
July 23, 2025 - The JSON.stringify() method converts an array including even the nested arrays and objects to a JSON string.
🌐
Alma Better
almabetter.com › bytes › articles › array-to-string-javascript
How to Convert Array to String in JavaScript
June 20, 2024 - You can use this feature to convert an array to a string by iterating over its elements. ... In some cases, you might need more control over the array to string conversion process.
🌐
Will Vincent
wsvincent.com › javascript-convert-array-to-string
JavaScript: Convert Array to a String | Will Vincent
January 3, 2018 - Finally, if you can’t use a built-in method for some reason, you can loop through the array and convert it to a string manually. // 1. Use .toString() ['a', 'b', 'c'].toString(); // 'a,b,c' // 2. Coerce to string ['a', 'b', 'c'] + []; // 'a,b,c' ['a', 'b', 'c'] + ''; // 'a,b,c' // 3. Use .join() ['a', 'b', 'c'].join(); // 'a,b,c' (defaults to ',' separator) ['a', 'b', 'c'].join(''); // 'abc' ['a', 'b', 'c'].join('-'); // 'a-b-c' // 4. Use JSON.stringify() JSON.stringify(['a', [1], 'b', 'c']); // '['a', [1], 'b','c']' // 5.
🌐
Mastering JS
masteringjs.io › tutorials › fundamentals › array-tostring
Array toString() in JavaScript - Mastering JS
December 8, 2021 - To convert an array to a string in JavaScript, you can use the toString() method.
🌐
TutorialsPoint
tutorialspoint.com › article › how-to-convert-an-array-into-javascript-string
How to convert an array into JavaScript string?
March 15, 2026 - The toString() method is a built-in JavaScript function that converts array elements into a comma-separated string.
🌐
Medium
medium.com › @louistrinh › converting-arrays-to-strings-in-javascript-4d1bbea80c20
Converting Arrays to Strings in JavaScript | by Louis Trinh | Medium
November 20, 2024 - The built-in toString() method on Arrays converts each element to a String and joins them with commas.
🌐
YouTube
youtube.com › watch
JavaScript Basics - How To Convert An Array Into A String - YouTube
In this tutorial I'll show you how to convert an array into a string in JavaScript.-------------------------------------------------------------------All my ...
Published: November 18, 2024
🌐
Devtalk
forum.devtalk.com › general developer forum › general questions/help
Converting an Array to a String in JavaScript - General Questions/Help - Devtalk
September 22, 2023 - I have an array of strings in JavaScript, and I need to convert it into a single string with specific delimiter characters between the elements. Here’s a sample array: let myArray = ["apple", "banana", "cherry", "date"]; I want to convert this array into a single string with a comma and space (", ") between each element.
🌐
Medium
medium.com › konsole-blog › 5-ways-to-convert-array-to-string-in-javascript-f6a92ac5788f
5 ways to convert Array to String in Javascript | by David Petrosyan | Konsole.blog | Medium
May 23, 2022 - We check to see if the element is equal to 'b'. If it is, we append that element with a separator. Otherwise we append the element without the separator. You can also use the array.reduce() method for joining with custom logic. The previous example with a for loop can be rewritten like this: const myArray = ['a', 'b', 'c', 'c', 'b', 'a', 'd']const myString = myArray.reduce((stringAccumulator, currentElement) => { const separator = ';' if (currentElement === 'b') { return stringAccumulator += (currentElement + separator) } return stringAccumulator += currentElement }, '')console.log(myString) // 'ab;ccb;ad'
🌐
YouTube
youtube.com › watch
How to convert an array into a string with JavaScript - YouTube
Source code from this tutorial: https://gist.github.com/cferdinandi/f6a9578f0b1524b434d8831bb1822d95Hate the complexity of modern front‑end web development?
Published: April 21, 2023