here I define the variable results to be an array of strings:
let results: string[];
and here below, I assign a value to kick things off:
results['searchCaption'] = "";
and then, the show stops with ERROR TypeError: Cannot set property 'searchCaption' of undefined
What am I missing here? Do I need to define an interface for it first?
let results: string[] = []? It would appear from the error that results is undefined, indicating that you never assigned anything to it.string[]only defines what type the variable is. It doesn't assign anything to it.results['searchCaption'] = "";is not a valid array syntax. Arrays are index based - objects are key based.let results: string[];would kicks things off with results = [] anyway! I think in ASP, it was not the case, my memory mislead me. Thank you! CRice!