I want to insert different array values per object into an array inside the object.
I have an arrayDetail object.
console.log(arrayDetail)
[
{
"content": "stackoverflow1",
"type": "one"
"appleId": undefined
},
{
"content": "stackoverflow2",
"type": "two"
"appleId": undefined
}
]
I have an applesIds array.
console.log(applesIds);
[49,50]
This is the result I want.
I tried a few times using map function or Object.fromEntries() function and looked up other stack overflow questions,
but I can't get it to work.
[
{
"content": "stackoverflow1",
"type": "one"
"appleId": 49
},
{
"content": "stackoverflow2",
"type": "two"
"appleId": 50
}
]