How to get unique values from object array property in JavaScript

Objects
Last updated Mar 06, 2018
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"]