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
¿Hay alguna manera de usar una variable dentro de una función de flecha pero inicializarla dentro de otra función donde también se llama a la función de flecha?

Estoy tratando de acceder a la variable c que se inicializa dentro de myFunc cuando llamo a sum.

 let sum = (a,b) => { let result = a + b + c; return result; } function myFunc(){ let c = 5; return sum(1,2); } console.log(myFunc());

Pero recibo un error debido a la c que uso dentro de la función de flecha. No sé si me estoy explicando bien, pero creo que entiendes el punto al ver el código de arriba.

about 4 years ago · Santiago Trujillo
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!