for (let i = 0; i < this.tableData.length; i++) {
const itemList = this.tableData[i] as any;
const newkey: any = Object.keys(itemList).sort(function compareFunction(
item1,
item2
) {
return item1.localeCompare(item2);
});
const newObj = {} as any;
for (let i = 0; i < newkey.length; i++) {
newObj[newkey[i]] = itemList[newkey[i]];
}
const newList = [] as any;
Object.keys(newObj).map((item: any) => {
const obj = {
name: item,
value: newObj[item],
} as any;
newList.push(obj);
});
console.log(newList);
}