给定以下数组,我们如何编写代码以按姓氏、名字降序对包含的对象进行排序?
[
{key: 1, firstName: "George", lastName: "Jones"},
{key: 1, firstName: "Alison", lastName: "Clarke"},
{key: 1, firstName: "Ben", lastName: "Smith"},
{key: 1, firstName: "Xavier", lastName: "Clark"},
{key: 1, firstName: "Harold", lastName: "Timmins"}
]
我不知道如何继续这件事,我想你们可能会有所帮助。
谢谢