Currently, I am encountering an issue with converting an object into an array of objects. The object I have is structured as follows:
const employeeDetails = {
"admin-name": "deepak",
"admin-age": "29",
"tester-name": "raju",
"tester-age": "26",
};
The desired format is:
const employeeDetails = [
{
_id: "admin",
name: "deepak",
age: 29,
},
{
_id: "tester",
name: "raju",
age: 26,
},
];