I encountered an issue with Typescript 4.9 that I'm struggling to resolve. While I grasp the reason behind the error, I am unsure of how to work around it. I attempted nullish coalescing, but it led to more errors. The parameter will consistently be a two-dimensional array containing one or more sets of data.
private CreatePlots(data: []) {
let valData = data[0][0];
let plotInfo = <EpmsPlotQueryData>data[0][1];
GUI.setPopupMsg("Loading query data " + this._processResults + " of " + this._PlotQueryList.length);
plotInfo.createPlots(valData);
}
The error is arising in both references to data; https://i.sstatic.net/gREyG.png
https://i.sstatic.net/5r3NR.png
To bypass these errors, I could modify the function to have data defined as any, like so:
private CreatePlots(data)
However, I'm curious as to why I can't use an empty array as in JavaScript.