Within my current project, I am working with two arrays. The first array, arr1, contains a questionID property that I need to use to combine it with arr2 based on the condition where arr1 questionID equals arr2 index.
For example, if arr1 questionID is 1, it should be matched with arr2 index 1.
I am wondering if achieving this outcome is feasible.
Although I have made an attempt using the code provided below, it seems to only combine the arrays based on their respective indexes:
this.combinedArray = [this.content, this.studyQuestions].reduce((a, b) => a.map((c, i) => Object.assign({}, c, b[i]))