Home > Blockchain >  How can I store an array in a variable using a FOR with TypeScript?
How can I store an array in a variable using a FOR with TypeScript?

Time:04-06

Hello friends I need your help with a solution I describe the context.

  • We have the ress array is bounded only with those that match the condition

Code   Printing

  • Once this is done I need to save the array results in a new variable, I tried several ways but it didn't work.

this.listavacacionesAcot[i] = ress[i]

Enter code, result

I hope as a result

this.listavacacionesAcot = [ {data}, {data}, {data} ]

CodePudding user response:

In your if condition

this.listavacacionesAcot.push(ress[i])

remove lines 156, 166

CodePudding user response:

The variable is modified, remaining from ListavacacionesAcot; to

listavacacionesAcot=[]

I take into account Garrett Witzenburg's comment

this.listavacacionesAcot.push(ress[i])

Solución

  • Related