My object look something like this.
var fruits = [
{
name: 'apple',
color: 'golden'
},
{
name: 'pear',
color: 'green'
},
{
name: 'mango',
color: 'yellow'
}
]
Now what i want is an array of the names of the fruit from the fruit object
console.log(getFruitNames(fruits)) //['apple','pear','mango']