TypeScript: Cannot read property 'push' of undefined in [null]
The array needs to be initialized:
stringArr = [];
For me the syntax was a little more than the accepted answer because I was using a full array type.
stringArr: Array<string> = [];
Also, this would work too
stringArr: string[] = [];
Just 2 ways to type a new array