I need help in getting values of specific property of an array of multiple objects I have an array like this:
[
{
"id": 1,
"name": "skill 1"
},
{
"id": 2,
"name": "skill 2"
},
{
"id": 3,
"name": "skill 3"
}]
and I want to get a string like this :
skill 1 - skill 2 - skill 3
myArray.map((v) => v.name).join(" - ")would do the trick.reduceis just an overcomplicated loop. Use a loop instead.