ERROR Error: Uncaught (in promise): TypeError: n.search_sn_result is not a function

Hi all ! Could anyone suggest please … what i did wrong ? Could not fix this error …

@Component({
  selector: 'page-sn-result',
  templateUrl: 'sn-result.html',
})
export class SnResult {

  public search_sn_result;

  constructor(public navCtrl: NavController,
              public platform:Platform,
              public file: File,
              public modelContentProvider:ModelContentProvider,
              public fileOpener: FileOpener,
              public settingsProvider:SettingsProvider,
              public navParams: NavParams) {


    this.platform.ready().then(() => {

      this.search_sn_result = this.navParams.get("search_sn_result");

      this.createFirstLevelTree().then(()=>{

      
      });

    });

  }


  createFirstLevelTree(): Promise<any>{

    return new Promise((resolve, reject)=> {

      this.first_level_tree = [];
      for (let i = 0; i < this.search_sn_result.length; i++) {
        console.log("this.search_sn_result(i)",this.search_sn_result(i).nodeType);
      }
      resolve(true);
    });
  }

}


I don’t see any reason you’re instantiating a Promise here, but the fundamental problem is that () and [] mean completely different things in JavaScript, and you’re calling a function where you intend to access an array element.

rapropos, thanks, I solved problem …