I have an array: this.entries = []. I run some code and it runs through this if statement several times:
if(this.entries[2] != null)
Everything works fine until after all the code runs I reset the array:
I've tried doing this.entries = [] and this.entries.splice(0, this.entries.length);
I re-run the code and when it gets to the if statement I get this error:
Cannot read property '2' of null
As far as I can tell there is nothing different. Tips and help would be very appreciated.