有没有办法对这个数组中的返回对象进行排序

const primary = State.products.find((p) => p.id === primaryId);

我如何排序数组中返回的对象