If your array of objects is items, you can do:

var items = [{
  id: 1,
  name: 'john'
}, {
  id: 2,
  name: 'jane'
}, {
  id: 2000,
  name: 'zack'
}];

var names = items.map(function(item) {
  return item['name'];
});

console.log(names);
console.log(items);

Documentation: map()

Answer from techfoobar on Stack Overflow
Discussions

javascript - Convert array of strings into an array of objects - Stack Overflow
Since it was confusing for some ... valid JavaScript, instead of copy-pasted console outputs. ... Array#map applies the callback to each element in the array and returns a new array containing the return values of the callback. ... Sign up to request clarification or add additional context in comments. ... @Kinduser: The OP has an array of strings and wants an array of objects... More on stackoverflow.com
🌐 stackoverflow.com
Convert array of key:value pair objects to string
There are two main approaches for this. The first is pretty straightfoward: do the first bits, then join: data.map(({ name, value }) => `${name}=${value}`).join('/'); You first join the data into an array like this ['a=b', 'c=d', 'e=f'] than just use the String join() function to join those with slashes. The slightly fancier way would be to use .reduce(): data.reduce((str, { name, value }) => `${str}${str ? '/' : ''}${name}=${value}`, '') This one you're just adding each onto the string. This one is a little harder to read, but has the advantage of only one loop through the data instead of two like the other. Better if you're getting lots of data (hundreds or thousands of records). The ternary bit in there (?:) is simply to ensure you don't get a "/" at the start of the string. More on reddit.com
🌐 r/learnjavascript
9
2
March 19, 2021
javascript - Convert an array of object to array of string? - Stack Overflow
ES5 (with shims for ES3) has Array#map. No need for _ here. Don't get me wrong, _ is useful, but is going to 'require a library' it might as well be a standards-shim. 2015-08-14T05:25:20.383Z+00:00 ... Save this answer. ... Show activity on this post. I guess you want to join all members of the object to a string... More on stackoverflow.com
🌐 stackoverflow.com
How can I convert an array of strings to an array of objects in JavaScript? - Stack Overflow
1 What is the best way to convert an array of strings into an array of objects? ... 0 How can I convert a string containing an array of javascript objects, into an array of javascript objects? More on stackoverflow.com
🌐 stackoverflow.com
🌐
GeeksforGeeks
geeksforgeeks.org › how-to-convert-string-of-objects-to-array-in-javascript
How to Convert String of Objects to Array in JavaScript ? | GeeksforGeeks
August 30, 2024 - Using new Map() ConstructorThe Map constructor can directly create a Map from an array of key-value pairs. If each object in the array has a specific key-value structure, you can map it accordingly.JavaScriptcon ...
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Array › toString
Array.prototype.toString() - JavaScript - MDN Web Docs
The toString method of arrays calls join() internally, which joins the array and returns one string containing each array element separated by commas. If the join method is unavailable or is not a function, Object.prototype.toString is used instead, returning [object Array]. ... const arr = ...
🌐
sebhastian
sebhastian.com › javascript-array-string
Convert a JavaScript array to string | sebhastian
February 1, 2023 - As you can see from the examples in this article, there are multiple ways you can convert a JavaScript array to a string. It all depends on your needs and preferences. Sometimes you need to convert an array of objects.
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › how-to-convert-string-to-array-of-objects-javascript
How to Convert String to Array of Objects JavaScript ? | GeeksforGeeks
August 30, 2024 - To convert an object to string using JavaScript we can use the available methods like string constructor, concatenation operator etc. Let's first create a JavaScript object. JavaScript // Input object let obj_to_str = { name: "GeeksForGeeks", ...
🌐
Medium
medium.com › @louistrinh › converting-arrays-to-strings-in-javascript-4d1bbea80c20
Converting Arrays to Strings in JavaScript | by Louis Trinh | Medium
November 20, 2024 - Arrays with Objects: When using toString(), objects inside the Array become [object Object]. To display object content, use JSON.stringify(). Arrays with null or undefined: toString() converts null or undefined to empty strings. const arr = ...
🌐
TutorialsPoint
tutorialspoint.com › How-to-convert-an-array-into-JavaScript-string
How to convert an array into JavaScript string?
August 22, 2022 - The JSON.stringify() method converts JavaScript objects and arrays into JSON string format.
🌐
Mastering JS
masteringjs.io › tutorials › fundamentals › array-tostring
Array toString() in JavaScript - Mastering JS
December 8, 2021 - let obj = {a:1, b:2,c:3}; let array ... new MyObject()].toString(); // 'test,test' In Node.js, you can import the util module and use the inspect() function....
🌐
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
🌐
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
🌐
W3Schools
w3schools.com › jsref › jsref_tostring_array.asp
JavaScript Array toString() Method
The toString() method returns a string with array values separated by commas. The toString() method does not change the original array. Every JavaScript object has a toString() method.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › convert-array-to-string-in-javascript
Convert Array to String in JavaScript - GeeksforGeeks
July 23, 2025 - Using default separator: a,b,c Using space as a separator: a b c Using hyphen as a separator: a-b-c Type of str1: string , Type of str2: string , Type of str3: string · The JSON.stringify() method converts an array including even the nested ...