我想按“用户”对象中的“名称”对下面的数组进行排序varmyArr=[{"id":1,"user":{"name":"allen","id":101}},{"id":2,"user":{"name":"martin","id":102}}]我该怎么做?我有一种方法可以对对象数组进行排序,但我不能将它用于对象的对象数组这是方法:functiondynamicSort(property){varsortOrder=1;if(property[0]==="-"){sortOrder=-1;property=property.substr(1);}returnfunction(a,b){var