After doing an Sql query, I have an array that looks like the one below. I would like to retrieve only the "name" column in a way that the names are like this: "Name1, Name2, Name3". I have no idea how to do this, I looked on the internet but I find nothing conclusive. Do you have any idea how to retrieve all the data from the "name" column? Thank you in advance.
Array =
[1] {
id_idx: 1,
hero_order: 0,
name: 'Nom1'
},
[2] {
id_idx: 1,
hero_order: 0,
name: 'Nom2'
},
[3] {
id_idx: 1,
hero_order: 0,
name: 'Nom3'
}
I forgot one information: the array comes from an SQL query rows2[].name.
let result=array.map(data=>data.name)