I made an array of type dataRows which is an interface
dataArray: Array<dataRows>;
then in a function I pushed a dataRows object into it
this.dataArray.push(row)
so why do I get Cannot read property 'push' of undefined in the console?
You are most likely getting the error Cannot read property 'push' of undefined because your dataArray hasn't been defined yet, and is thus undefined - a blank object with no methods.
You need to initialise it with an empty array, like:
dataArray: Array<dataRows> = [];
to then be able to use the .push method to append your row to it.
dataArray: Array<dataRows> = [];.