const objects = [
{ id: 1, category: "Cars" },
{ id: 2, category: "Cars" },
{ id: 3, category: "Smatphones" },
{ id: 4, category: "Cars" },
{ id: 5, category: "Tablet" }
];
const categories = [...new Set(objects.map(object => object.category))];
["Cars", "Smartphones", "Tablet"]