If you want to map objects to something (in this case a property). I think Array.prototype.map is what you're looking for if you want to code functionally.

(fiddle)

If you want to support older browsers, that are not ES5 compliant you can shim it (there is a polyfill on the MDN page above). Another alternative would be to use underscorejs's pluck method:

var users = [
      {name: "Joe", age: 22},
      {name: "Kevin", age: 24},
      {name: "Peter", age: 21}
    ];
var result = _.pluck(users,'name').join(",")
Answer from Benjamin Gruenbaum on Stack Overflow
๐ŸŒ
Codemzy
codemzy.com โ€บ blog โ€บ array-join-object-property
Using Array join() on an object property - Codemzy's Blog
May 30, 2023 - We need to create an array of strings (or numbers) before we use .join(). In this case, we want the first name and the last name. And we can use .map() to get those object properties, before using .join().
๐ŸŒ
SitePoint
sitepoint.com โ€บ blog โ€บ javascript โ€บ how to merge objects in javascript
How to Merge Objects in JavaScript โ€” SitePoint
November 5, 2024 - Learn how to merge any object in JavaScript with the spread ( ... ) operator, Object.assign() method, and JSON stringify and parse methods.
๐ŸŒ
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.
๐ŸŒ
CoreUI
coreui.io โ€บ blog โ€บ how-to-merge-objects-in-javascript
How to Merge Objects in JavaScript ยท CoreUI
February 27, 2024 - Deep Merging: Involves recursively merging properties of nested objects, ensuring that each level of the object structure is combined accurately. Shallow merging is straightforward in JavaScript, thanks to modern ES6 features like the spread operator (...) and the Object.assign() method.
๐ŸŒ
JavaScript Tutorial
javascripttutorial.net โ€บ home โ€บ javascript merge objects
How to Merge Objects in JavaScript
March 29, 2020 - In this tutorial, you have learned how to merge objects in JavaScript using the spread operator (...) and Object.assign() method.
Find elsewhere
๐ŸŒ
W3Resource
w3resource.com โ€บ javascript โ€บ object-property-method โ€บ array-join.php
Array Object - JavaScript join() Method
var fruits = new Array("Orange", "Apple", "Banana", "Chery"); var fruitslist1=fruits.join(); var newParagraph = document.createElement("p"); var newText = document.createTextNode("Fruits List : " + fruitslist1 ); newParagraph.appendChild(newText); document.body.appendChild(newParagraph); var fruitslist2=fruits.join(', '); var newParagraph1 = document.createElement("p"); var newText1 = document.createTextNode("Fruits List : " + fruitslist2); newParagraph1.appendChild(newText1); document.body.appendChild(newParagraph1); var fruitslist3=fruits.join('-'); var newParagraph2 = document.createElement("p"); var newText2 = document.createTextNode("Fruits List : " + fruitslist3); newParagraph2.appendChild(newText2); document.body.appendChild(newParagraph2); ... JavaScript Core objects, methods, properties.
๐ŸŒ
Medium
daviddalbusco.medium.com โ€บ merge-two-objects-and-array-to-object-in-javascript-79580583727a
Merge Two Objects And Array To Object In JavaScript | by David Dal Busco | Medium
April 3, 2020 - Thanks to the introduction of Spread Operator in ES6, it is now more than ever before really easy to merge two objects.
๐ŸŒ
GitHub
gist.github.com โ€บ lucasdavila โ€บ 4331999
Joining javascript key-value objects as string. ยท GitHub
Joining javascript key-value objects as string. GitHub Gist: instantly share code, notes, and snippets.
๐ŸŒ
Scaler
scaler.com โ€บ home โ€บ topics โ€บ javascript merge objects
JavaScript Merge Objects - Scaler Topics
May 4, 2023 - Then what should happen in that case? That's where the understanding of shallow merge and deep merge comes into the picture. Let's now try to understand it with the help of examples. ... We can merge two JavaScript objects using the built-in javascript's spread(...) operator.
๐ŸŒ
30 Seconds of Code
30secondsofcode.org โ€บ home โ€บ javascript โ€บ object โ€บ merge objects
Merge two or more JavaScript objects - 30 seconds of code
March 20, 2024 - const deepMerge = (a, b, fn) => [...new Set([...Object.keys(a), ...Object.keys(b)])].reduce( (acc, key) => ({ ...acc, [key]: fn(key, a[key], b[key]) }), {} ); const obj1 = { a: true, b: [1, 2, 3], c: { d: 4, e: 5 }, f: 'foo', }; const obj2 = { a: false, b: [4, 5, 6], c: { d: 6, g: 7 }, f: 'bar', }; const concatFn = (key, a, b) => { if (Array.isArray(a) && Array.isArray(b)) return a.concat(b); if (typeof a === 'object' && typeof b === 'object') return deepMerge(a, b, concatFn); if (typeof a === 'string' && typeof b === 'string') return [a, b].join(' '); return b ?? a; }; deepMerge(obj1, obj2, concatFn); // { // a: false, // b: [ 1, 2, 3, 4, 5, 6 ] // c: { d: 6, e: 5, g: 7 }, // f: 'foo bar' // } Collection ยท 114 articles ยท Master array manipulation in JavaScript with this ES6 article collection.
๐ŸŒ
Stack Abuse
stackabuse.com โ€บ merge-properties-of-two-objects-dynamically-in-javascript
Merge Properties of Two Objects Dynamically in JavaScript
October 4, 2023 - In this tutorial, we'll go over how to merge two objects dynamically in JavaScript, using the spread operator and the Object.assign() method, with practical examples.
๐ŸŒ
Medium
medium.com โ€บ better-programming โ€บ combining-javascript-objects-e293bc4a48a6
3 Ways To Combine JavaScript Objects | by Corey Butler | Better Programming
March 5, 2021 - Ask yourself how easy it is to Google three dots (โ€ฆ) and their meaning โ€” especially if you donโ€™t know JavaScript has spread operators. Object.assign() and the spread operator are both shallow merging techniques. Shallow merging only combines attributes at the first level of the object.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ javascript โ€บ es6-merge-objects
ES6 Merge Objects - GeeksforGeeks
July 12, 2025 - Example 1: In this example, we have taken two objects 'obj1' and 'obj2', and then passed them into object.assign() as an argument and stored them in 'Object' after merging.
๐ŸŒ
DEV Community
dev.to โ€บ shubhamtiwari909 โ€บ join-in-javascript-4050
Array Methods in JS - join() - DEV Community
August 21, 2022 - It is used to join the elements of array and returns them as a string Example - arr -> ["A","B","C","D"] After applying join() method on this array result -> A,B,C,D ... const emptyArray = [] const numberArray = [1,2,3,4,5]; const stringArray ...
๐ŸŒ
xjavascript
xjavascript.com โ€บ blog โ€บ perform-join-on-value-in-array-of-objects
How to Perform .join() on Values in an Array of Objects by Property in JavaScript โ€” xjavascript.com
Joining values from an array of objects by property is a common task in JavaScript, and the solution is surprisingly simple: use map() to extract the property values into a primitive array, then join() to combine them into a string.
๐ŸŒ
DEV Community
dev.to โ€บ ratracegrad โ€บ how-to-merge-objects-in-javascript-106p
How to Merge Objects in JavaScript - DEV Community
January 13, 2023 - Using Object.assign does not create a new object. Instead, it copies all the source objects into the target object.