I have an array like below I am trying to add some value by replacing null inside the object inside the array. The values I wanted to add is from different array "y"
let toBesubmitted = [
{a: null, id: "a"},
{b: null, id: "b"},
{c: null, id: "c"},
{d: null, id: "d"},
{e: null, id: "e"}
]
Another array
let y= ["apple", "ball", "cat", "dog", "elephant"]
How can I achieve this?