For example i have an array like
const student = [
{ firstName: 'Partho', Lastname: 'Das' },
{ firstName: 'Bapon', Lastname: 'Sarkar' }
];
const profile = [
{ education: 'SWE', profession: 'SWE' },
{ education: 'LAW', profession: 'Law' }
];
Now i want to merge those two object like
const student1 = [
{
firstName: 'Partho',
Lastname: 'Das',
profile: [{
education: 'SWE',
profession: 'SWE'
}]
}
];
const student2 = [
{
firstName: 'Bapon',
Lastname: 'Sarkar',
profile: [{
education: 'LAW',
profession: 'Law'
}]
}
];
I am new to javascript, i am trying it many ways but couldn't. please help me to solve this using javascript.
Thanks... in advance.