I wrote the following setter 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();
}
Assuming data contains one item, this prints
undefined
false
object
Why is this happening? Shouldn't just objects of type Data be in the array, if I specified it like that?
datayou pass?