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

160
Views
¿Por qué la función de flecha 'esta' se comporta de manera diferente en las clases de Javascript frente al objeto literal?

Estoy confuso sobre el comportamiento de las funciones de flecha. Por favor, mire el siguiente ejemplo:

 class Test { foo2 = () => { console.log(this) } } let t1 = new Test let Test2 = { foo2: () => { console.log(this) } } t1.foo2() Test2.foo2()

Test2.foo2() devuelve un objeto vacío que tiene sentido ya que las funciones de flecha no tienen "esto" propio, pero ¿por qué t1.foo2() registra el objeto t1? ¿No son ambas situaciones iguales?

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!