1
I would like to know how to get only one object attribute ...
const person = [
{ name: 'Jane', age: 55 },
{ name: 'Rafael', age: 23 },
{ name: 'Carolina', age: 19 },
{ name: 'Bob', age: 47 },
{ name: 'Julia', age: 62 },
{ name: 'Joy', age: 43 }
];
const biggestNames = person.filter(person => person.name.length >= 5);
console.log(biggestNames);
So in this way, I will return the obj’s with the biggest names according to the argument that was passed (person.name.length >= 5)
, but I would like it to return only the value of the attribute name of my obj, and not the complete obj ({ name: x, age: x })
in you...
Thanks ...