I'm working with two arrays in my code: one is called Indicators and the other is Departments.
My task is to link each department to every indicator. So, if there are 4 departments, I need to create 4 indicators, each with a different department but at the same index. How can I accomplish this?
EDIT: Here's the snippet of my code:
let departmentArray = []
this.DepartmentIR.forEach(entry=>{
departmentArray.push(entry.Department)
})
this.RisksIndicatorsIR.forEach(entry=>{
let temp = {...entry}
temp.Departments = departmentArray
console.log(temp)
})
})