Looking for a way to flatten the array below into a single line array using Typescript/JavaScript?
Student: any = [
{ "id": "1", "name": "Jhon", "Marks": { "Math": "90", "English": "80", "Science": "70" } },
{ "id": "2", "name": "Peter", "Marks": { "Math": "95", "English": "85", "Science": "75" } }
];
The desired output should be:
NewStudent = [
{ "id": "1", "name": "Jhon", "Math": "90", "English": "80", "Science": "70" },
{ "id": "2", "name": "Peter", "Math": "95", "English": "85", "Science": "75" }
];