Error: Cannot read property 'push' of undefined in [null].
class A implements OnInit {
stringArr: string[];
ngOnInit() {
for(let i=0; i<4; i++) {
this.stringArr.push("aaa");
}
}
}
Run Code Online (Sandbox Code Playgroud) typescript ×1