I have array format like this
newresponse = [{
data: {
Bal Vivah: 1
Type: 0
districts: "East District"
},
data: {
Bal Vivah: 1
Type: 0
districts: "West District"
},
data: {
Bal Vivah: 1
Type: 0
districts: "North District"
}
}]
and the required format is
newresponse = [{
data: {
districts: "East District"
Bal Vivah: 1
Type: 0
},
data: {
districts: "West District"
Bal Vivah: 1
Type: 0
},
data: {
districts: "North District"
Bal Vivah: 1
Type: 0
}
}]
here I need the value of the districts at the beginning of the array, other then districts all key and values will be dynamic, hence districts should be on the top of the array.