I would like to sort my array to do this I declared 2 temporary array but the both array are already filled even just after the initialization. Seems like i got a memory problem
let tmpCheckDeals : any[] = [];
let tmpUncheckDeals: any[] = [];
    console.log('Init :' , tmpCheckDeals, tmpUncheckDeals);
    this.checkedDeals.forEach(element => {
      tmpCheckDeals.push(element);
    });
    for (let i = 0; i < this.deals.list.length; i++) {
      let isInside : boolean = false;
      const element = this.deals.list[i];
      for (let a = 0; a < this.checkedDeals.length; a++) {
        const element1 = this.checkedDeals[a];
        if(element == element1)
          isInside = true;
      }
      if(isInside == false) {
        console.log('Passe');
        tmpUncheckDeals.push(element);
      }
      isInside = false;
    }
Result of my console: console
As you can see my arrays are already filled
Do you have an idea why i get this error pls ? Thanks
 
    