Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

157
Vistas
Use el objeto del mapa en lugar de los parámetros correctamente

Quiero usar el objeto de mapa en lugar de llamar a checkOrder 3 veces. ¿Cómo usar a través de Map en lugar de todos los parámetros en este caso? :

Admin.ts

 class Admin{ async checkTest( local: string, suburb: string, international: string ): Promise<void> { await checkOrder(local, "Declined"); await checkOrder(suburb, "Declined"); await checkOrder(international, "Declined"); return; } }

Prueba.ts

 test("Test", async (t) => { await Admin.checkTest( "Local Place", "Suburb Place", "International Place" ); ); }
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

@Thomas Quiero usar el objeto de mapa en lugar de llamar a checkOrder 3 veces.

¿como esto?

 class Admin { async checkTest(map: Map<Place, Status>) { for (let [place, status] of map) { await checkOrder(place, status); } } }

y

 test("Test", async (t) => { await Admin.checkTest( new Map([ ["Local Place", "Declined"], ["Suburb Place", "Declined"], ["International Place", "Declined"], ]) ); });
about 4 years ago · Juan Pablo Isaza Denunciar

0

Entonces, ¿es correcto usar el mapa en mi caso?

 class Admin { async checkTest(map: Map<string, string>) { for (let [place, status] of map) { await checkOrder(place, status); } } }

y

 test("Test", async (t) => { await Admin.checkTest( new Map([ ["Local Place", "Declined"], ["Suburb Place", "Declined"], ["International Place", "Declined"], ]) ); });
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda