Use map instead of forEach and drop the parenthesis and the curly braces in the lambda:

var userNames = objectArr.map(o => o.userName).join(', ');

Answer from Nikola Dimitroff on Stack Overflow
๐ŸŒ
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.
๐ŸŒ
Codemzy
codemzy.com โ€บ blog โ€บ array-join-object-property
Using Array join() on an object property - Codemzy's Blog
May 30, 2023 - You can use Array.join() on an array of objects, but `join()` will only work with strings, so you need to get the property value(s) first. Let's look at some examples.
Discussions

Joining property values of objects in an array
I have an array of objects. The objects have a property called userName. Is there a way to concatenate the userName values into a comma delimited string? I assume I can use the join function but th... More on stackoverflow.com
๐ŸŒ stackoverflow.com
Typescript join specific properties of an array as string - Stack Overflow
1 How to merge string array values to a particular property in object array in Type Script / Java Script ยท 0 How to join fields of an array of objects in javascript/typescript More on stackoverflow.com
๐ŸŒ stackoverflow.com
How to join fields of an array of objects in javascript/typescript - Stack Overflow
The join function of an array can only be used on the whole entry, not on fields of the object that is underneath. More on stackoverflow.com
๐ŸŒ stackoverflow.com
javascript - Perform .join on value in array of objects
Despite the code being slightly less clean/clear. It is a much more efficient than piping the map function to a join. The reason for this is because Array.map has to loop over each element to return a new array with all of the names of the object in the array. More on stackoverflow.com
๐ŸŒ stackoverflow.com
๐ŸŒ
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.
๐ŸŒ
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 - Here we will see how to convert an array to a string with a separator, using join() in TypeScript. The join method in TypeScript is used to join all the items of an array into a string.
๐ŸŒ
Webdevtutor
webdevtutor.net โ€บ blog โ€บ typescript-join-array-of-objects
Mastering Array Join in TypeScript: Joining Arrays of Objects
Another approach is to use the ... 'Alice, Bob, Charlie' If you need to join multiple arrays of objects together, you can use methods like concat() or the spread operator to merge them....
Find elsewhere
๐ŸŒ
Webdevtutor
webdevtutor.net โ€บ blog โ€บ typescript-join-object-array-to-string
How to Join Object Array to String in TypeScript
We use map to extract the name property and then join to join the names with a comma and space. Another method is to use the reduce function to build the final string by iterating over the array of objects.
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ JavaScript โ€บ Reference โ€บ Global_Objects โ€บ TypedArray โ€บ join
TypedArray.prototype.join() - JavaScript - MDN Web Docs
The join() method of TypedArray instances returns a new string that is the concatenation of all elements in this typed array, separated by commas or a specified separator string. If the typed array has only one item, that item's stringification is returned without using the separator.
๐ŸŒ
Mozilla
developer.mozilla.org โ€บ nl โ€บ docs โ€บ Web โ€บ JavaScript โ€บ Reference โ€บ Global_Objects โ€บ Array โ€บ join
Array.prototype.join() - JavaScript | MDN
July 10, 2025 - 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.
๐ŸŒ
daily.dev
daily.dev โ€บ home โ€บ blog โ€บ webdev โ€บ javascript join() method: syntax, examples & pitfalls
JavaScript join() Method: Syntax, Examples & Pitfalls | daily.dev
May 25, 2026 - The Array join() method converts arrays to strings with a custom separator. Covers syntax, handling null/undefined, performance in loops
๐ŸŒ
Webdevtutor
webdevtutor.net โ€บ blog โ€บ typescript-join-array-of-strings
Mastering String Array Joining in TypeScript
const stringArray = ["Hello", "World", "in", "TypeScript"]; const joinedString = stringArray.join(" "); console.log(joinedString); // Output: "Hello World in TypeScript" In the example above, we have an array of strings stringArray, and we use the join method with a space as the separator to ...
๐ŸŒ
Futurestud.io
futurestud.io โ€บ tutorials โ€บ javascript-join-an-array-of-strings-to-a-single-string-value
JavaScript โ€” Join an Array of Strings to a Single String Value
April 27, 2023 - The @supercharge/arrays package comes with a handy Arr#join method (like the native JavaScript array). The join method returns a string value of all items concatenated. By default, the package concatenates all values using a comma ,. You may provide your own separator as the first argument.
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ JavaScript โ€บ Reference โ€บ Global_Objects โ€บ Array โ€บ toString
Array.prototype.toString() - JavaScript - MDN Web Docs
A string representing the elements of the array. The Array object overrides the toString method of Object. The toString method of arrays calls join() internally, which joins the array and returns one string containing each array element separated by commas.