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

233
Vistas
How console log variables inside find method that inside a map method and return an object?

How console log variables inside find method that inside a map method and return an object ? That is an arrow function so I should use with function body and return statement. But I get error if i do.

So how can console log lbl and lbl.label inside find method?

Yes i should read how use arrow function. (this is exactly what I want to find out, among other things) Thank you

  useEffect(() => {
    setLabels((prevLabels) => {
      return [...new Set(savedEvents.map((evt) => evt.label))].map((label) => {
        const currentLabel = prevLabels.find((lbl) => lbl.label === label);

        console.log(`prevlabels: ${JSON.stringify(prevLabels)}`);
        console.log(`currentLabel: ${JSON.stringify(currentLabel)}`);
        console.log(`currentLabel.checked: ${currentLabel.checked}`);
        console.log(`label: ${label}`);
        return {
          label,
          checked: currentLabel ? currentLabel.checked : true,
        };
      });
    });
  }, [savedEvents]);
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