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

242
Views
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
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!