Just started diving into the array of objects sorting in JavaScript, having come up with the following snippet. Is there a chance this code can somehow be optimised for performance or does this look generally legit?

```js
const products = [
  {
    title: "Test product1",
    description: "Test description",
    price: 5,
    category: {
      title: 'hot_dishes',
      priority: 2
    },
    ru: {
        title: "Тестовый продукт",
        description: "пошел на хуй"
    }
  },
  {
    title: "Test product2",
    description: "Test description",
    price: 5,
    category: {
      title: 'dessert',
      priority: 1
    },
    ru: {
        title: "Тестовый продукт",
        description: "пошел на хуй"
    }
  }
];

const sorted = products
.map(({ category }) => category)
.sort((a, b) => parseFloat(a.priority) - parseFloat(b.priority))
.map(({ title }) => (
  products.filter(({ category: { title: cTitle } }) => title === cTitle)
));

console.log(sorted);
```

Workflow:

1. Destructure category from each product
2. Sort the in ascending order
3. Filter in separate arrays, based on the category title

My current biggest concern is about the following line:

```js
.map(({ title }) => (
  products.filter(({ category: { title: cTitle } }) => title === cTitle)
));

```