Here is the object.
let newObj = {
firstValue:"abc",
content:[
{
"value": "123",
"checked": true
},
{
"value": "456",
"checked": false
},
{
"value": "789",
"checked": true
}
]
}
In this firstValue is abc so while mapping abc should come first like this:
let newObj = {
firstValue:"abc",
content:[
{
"value": "abc",
"checked": true
},
{
"value": "123",
"checked": false
},
{
"value": "789",
"checked": true
}
]
}
To achieve this using javascript, you can use a function to rearrange the objects in the array based on the value of 'firstValue' property.
Hope this helps!