here is my use case: I have two arrays of objects that come from two observables and I have created a combineLatest method to iterate the array into one with mapped Ids:
var result1 = [{ question: 1, answerList: [{ answer: 'Sandra', isDefault: 'true' }, { answer: 'John', isDefault: 'false' } ] }, { question: 2, answerList: [{ answer: 'Peter', isDefault: 'false' }, { answer: 'Bobby', isDefault: 'false' } ] }, { question: 3, answerList: [{ answer: 'Harry', isDefault: 'false' }, { answer: 'Bob', isDefault: 'false' } ] } ] var result2 = [{ question: 1, answer: 'John' }, { question: 3, answer: 'Bob' } ]; My goal is to have another array of objects containing elements like this:
var finalResult = [{ question: 1, answerList: [{ answer: 'Sandra', isDefault: 'false' }, { answer: 'John', isDefault: 'true' } ] }, { question: 2, answerList: [{ answer: 'Peter', isDefault: 'false' }, { answer: 'Bobby', isDefault: 'false' } ] }, { question: 3, answerList: [{ answer: 'Harry', isDefault: 'false' }, { answer: 'Bob', isDefault: 'true' } ] } ]
'true'/'false'as strings? should a not given question update the questions or leave it?