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

230
Vistas
How to return data outside of async

Im trying to change the value of a variable outside a map but i need the map to be an async so that i can use the await but it seemed after the map its not changing the value here is my code

let firstFilter = []
    Object.keys(filter).map(async(key, index)=>{
        if (index == 0) {
            options.push(where(key,'in',filter[key]))
            const q = query(collection(db, "Videos"),...options);
            const querySnapshot = await getDocs(q);
            const documents = querySnapshot.docs.map((doc) =>({ key_id: doc.id, ...doc.data() }));
            firstFilter.push(documents)
        }else{
            var number = firstFilter.filter((item,indexM)=>{
                if (filter[key].includes(item[key].toString())) {
                    return item
                }
            })
            firstFilter = number
        }
        options=[]
    })
    console.log("no data outside async", firstFilter);
about 4 years ago · Juan Pablo Isaza
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