I am trying to access the value inside of an array but console keeps coming back as undefined. The array does exist and it is populated as shown by console. Issue occurs when I make reference to anything inside of the array.
this.comments$.subscribe({next:(value) => this.a_s.squad.push(value[0])});
When i console log the array
console.log(this.a_s.squad)
That works fine now as we can tell the array does exist and it contains 1 object with an index of 0
Now If I am to console log this
console.log(this.a_s.squad[0])
This is a hindrance because I won’t be able to access, sport_event_status object in the array, since if I
console.log(this.a_s.squad.sport_event_status)
I get a message stating that this does not exist on type any[]
Now if i go back to adding [0]”The index”
console.log(this.a_s.squad[0].sport_event_status)
The message error in the code no longer exist, but in the console I get this error
Why is this happening ?