Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

111
Views
Filtrar matriz y luego mapear a través de resultados filtrados

Tengo una matriz que quiero usar como filtro:

 export const WHITE_LISTED_CONTRACTS = [ "0xcfc7b452a470e5533a1fe51ec6fed0596356c80f", // test "0x8a6bf00078d5776940c1707cd681afed0c5b0ff2", // test ];

Ahora, tengo una serie de tokens que quiero filtrar: solo el token.token_address incluido en la lista blanca debe token.token_address :

 {tokens.map((token, index) => { WHITE_LISTED_CONTRACTS.filter((whitelist) => { if (whitelist === token.token_address) { return ( <Component token={token} /> } });

¿Alguna idea de lo que estoy haciendo mal?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

está iterando (filtrando) la Lista blanca para cada token en su matriz,

Array.includes es el camino a seguir aquí

 {tokens.map((token, index) => { if(WHITE_LISTED_CONTRACTS.includes(token.token_address) { ... } } }
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!