Exploring the concept of JavaScript object arrays in TypeScript
In my current project, I am retrieving a JSON array from an observable. It seems that I can define and initialize the array without necessarily specifying an interface or type.
let cityList[]; // Is the value of cityList null at this point?
cityList[] = response;
Although using an interface is not mandatory, it is advisable for better compiler assistance similar to Java, right?
interface Blah{
city: string;
}
let cityList: Blah[];
cityList[] = response;
Alternatively, creating a constructor might be necessary if dynamically adding JavaScript objects to the array, is that correct?