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
🌐
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 ...
🌐
W3Schools
w3schools.com › jsref › jsref_tostring_array.asp
JavaScript Array toString() Method
cssText getPropertyPriority() getPropertyValue() item() length parentRule removeProperty() setProperty() JS Conversion · ❮ Previous JavaScript Array Reference Next ❯ · Convert an array to a string: const fruits = ["Banana", "Orange", "Apple", "Mango"]; let text = fruits.toString(); Try it Yourself » ·
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
Is there a way to convert an array into string like ["P" ,"A","N","D","A"] to PANDA ?
["P" ,"A","N","D","A"].join('') you can pass a string to join, to change the default behavior (which is joining with a comma). If you use an empty string you join the letters without additional characters. More on reddit.com
🌐 r/learnjavascript
26
47
January 4, 2022
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 ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Array › toString
Array.prototype.toString() - JavaScript - MDN - Mozilla
July 20, 2025 - The toString() method of Array instances returns a string representing the specified array and its elements.
🌐
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 - 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.
🌐
ReqBin
reqbin.com › code › javascript › ot8wzla9 › javascript-array-to-string-example
How do I convert array to string in JavaScript?
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.
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › string-to-array-in-javascript
JavaScript - Convert String to Array - GeeksforGeeks
August 5, 2025 - Modify parts of the string (like replacing characters or extracting substrings). Split a string into smaller components for easier processing. The most common method for converting a string to an array is using the split() method.
🌐
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

🌐
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.
🌐
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 provides an efficient way to convert an array into a string representation. This method is part of the Array prototype, and it offers a straightforward approach to creating a comma-separated string from an ...
🌐
Scaler
scaler.com › home › topics › array to string in javascript
Array to String in JavaScript - Scaler Topics
January 8, 2024 - There is no direct method present to do so. But if we take a closer look at the given scenario, then we will notice that the string contains all the elements of the array, and if we simply combine all the given elements into a single array, then we can get our array back.
🌐
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 - This approach is versatile, efficient, and provides complete control over how array elements are combined into strings. Use the join() method to convert an array into a string with a specified separator.
🌐
DigitalOcean
digitalocean.com › community › tutorials › js-converting-arrays-to-strings
Converting Arrays to Strings in JavaScript | DigitalOcean
December 5, 2019 - Learn how to convert an array to a string using JavaScript using the join method.
🌐
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.
🌐
Codedamn
codedamn.com › news › javascript
How to convert a JavaScript array to a string (with examples)?
October 27, 2022 - This means using the toString() method on myArray converted the array to a string. Lets us see the code demonstration of converting an array containing both strings and numbers to strings in JavaScript.
🌐
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.
🌐
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"]…