I have an array object and an object with the same amount of properties that array has.
I need to attach property values from object to every object of an array. To fill a value property
Array
0: {number: "1", type: "date", placeholder: "Semana", validations: Array(1), value: "value"}
1: {number: "2", type: "text", placeholder: "Marca", validations: Array(3), value: "value"}
[n]
Object
0: "23"
1: "34"
2: "sdfds"
[n]
Code
this.dataForm.forEach( (el) => {
Object.entries(formObject).forEach(([key, value]) => {
el.value = value
})
})
Can you help with it?
Expected result
0: {number: "1", type: "date", placeholder: "Semana", validations: Array(1), value: 23}
1: {number: "2", type: "text", placeholder: "Marca", validations: Array(3), value: 34}