I have an interface that looks like this:
export interface Stats {
lastFiveResults: Object[];
}
The array of objects looks this this:
(5) [{…}, {…}, {…}, {…}, {…}]
0: {idresults: 500, gold: 567740, mana: 305370, xp: 1800}
1: {idresults: 501, gold: 492381, mana: 602707, xp: 1450}
2: {idresults: 502, gold: 241012, mana: 303954, xp: 810}
3: {idresults: 503, gold: 415778, mana: 261254, xp: 810}
4: {idresults: 504, gold: 327266, mana: 427803, xp: 0}
And when I try and access it like this
data.lastFiveMatches[0].gold
I get Property gold does not exist on type object
So my question is how do I specify these properties?
lastFiveMatches.length === 0.