Answer the question
In order to leave comments, you need to log in
How to format an array of objects?
there is an array of objects
[
{
title: 'Tiger',
weight: '90',
category: {
id: '333',
name: 'heavy tank'
}
},
{
title: 'Amx 50b',
weight: '80',
category: {
id: '333',
name: 'heavy tank'
}
},
{
title: 'mt-25',
weight: '25',
category: {
id: '444',
name: 'light tank'
}
},
{
title: 'Vickers Light 105',
weight: '30',
category: {
id: '444',
name: 'light tank'
}
}
]
[
{
category: {
id: '444',
name: 'light tank',
tanks: [
{
title: 'Vickers Light 105',
weight: '30',
},
{
title: 'mt-25',
weight: '25',
}
]
}
},
{
category: {
id: '333',
name: 'heavy tank',
tanks: [
{
title: 'Tiger',
weight: '90'
},
{
title: 'Amx 50b',
weight: '80',
}
]
}
}
]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question