Here is the setter I created in TypeScript:
public set data(data: Array<Data>) {
console.log(data[0].getterProperty);
console.log(data[0] instanceof Data);
console.log(typeof data[0]);
this.setGridDataIfReady();
}
If data
contains only one item, the output is:
undefined
false
object
I am confused as to why this is happening. Shouldn't the array only contain objects of type Data
since that's what I specified?