After setting up the Array in my oninit function, I encountered an issue where one part of the array was functioning as intended while the other returned an error.
this.tests = [{
status: 0,
testresults: [{
name: 'test',
id: 1
}]
}
]
;
this.tests.push([{
status: 1,
testresults: [{
name: 'test2',
id: 2
}]
}
]
}]);
To achieve my goal of pushing query results into the testresults array inside tests, I used the following code:
this.tests[0].testresults.push(this.qryresults);
this.tests[1].testresults.push(this.qryresults);
Although Index 0 worked correctly, Index 1 resulted in the following error message being displayed:
"ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'push' of undefined
TypeError: Cannot read property 'push' of undefined"