when I am initializing array globally (outside the method) its working fine. but when I am initializing the same array inside the method its throwing error unexpected token. you can see into code for location of array. this is array calculateResult[] = [];
private log: string ='result';
private kw: string = 'kw';
private frame: number = 0;
public finalResult[] = [];
//here this array is working fine
calculateResult[] = [];
DisplayResult(){
//if i initialize this array here, it's throwing error
// calculateResult[] = [];
if(some_conditions_true){
alert();
this.log = '1SE0 070-2NC70' '\n';
this.kw = '.37' '\n';
this.frame = '71' '\n';
this.calculateResult[0] = this.log;
this.calculateResult[1] = this.kw;
this.calculateResult[2] = this.frame;
this.finalResult.push(this.calculateResult);
for(i=0;i < this.finalResult.length;i++){
console.log(this.finalResult[0][0]);
console.log(this.finalResult[0][1]);
}
}