const pluck = key => array => Array.from(new Set(array.map(obj => obj[key])));
const cars = [
{ brand: 'Audi', color: 'black' },
{ brand: 'Audi', color: 'white' },
{ brand: 'Ferarri', color: 'red' },
{ brand: 'Ford', color: 'white' },
{ brand: 'Peugot', color: 'white' }
];
const getBrands = pluck('brand');
console.log(getBrands(cars));
[
"Audi",
"Ferarri",
"Ford",
"Peugot"
]
very useful