作者:手机用户2502863161 | 来源:互联网 | 2023-07-17 03:35
IamdoingaprojectusingreactandIcannotsortthevaluesofseveralobjects.我正在使用react做一个项目,我
I am doing a project using react and I can not sort the values of several objects.
我正在使用react做一个项目,我无法对几个对象的值进行排序。
In fact, here is the structure of my objects:
实际上,这是我的对象的结构:
object1:
subobject1
hours: "06",
details:"lorem ipsum",
subobject2
hours: "04",
details:"lorem ipsum",
object2:
subobject1
hours: "05",
details:"lorem ipsum",
subobject2
hours: "01",
details:"lorem ipsum",
All recovered objects are in this same form.
所有恢复的对象都采用相同的形式。
I would like to display these objects by sorting on the "hours" property and return an object like this :
我想通过对“hours”属性进行排序来显示这些对象,并返回如下对象:
object1:
subobject1
hours: "04",
details:"lorem ipsum",
subobject2
hours: "06",
details:"lorem ipsum",
object2:
subobject1
hours: "01",
details:"lorem ipsum",
subobject2
hours: "05",
details:"lorem ipsum",
Can you help me please ?
你能帮我吗 ?
Thanks for any help
谢谢你的帮助
Edit : sorry, I was wrong about the structure
编辑:对不起,我错了结构
3 个解决方案