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

214
Views
¿Cómo puedo llamar a la función en una clase en Intervalos?
class Bases { getData() { // get some data and return data = 'hello'; return data; } process() { let greeting = this.getData(); console.log(greeting); } start() { setInterval(this.process, 5000) } } let b = new Bases; b.start();

Quiero llamar a la función 'proceso' para que imprima 'hola' cada 5 segundos, sin embargo, cuando llamo a b.start(), siempre aparece este error:

 TypeError: this.getData() is not a function

Cuando llamo a b.process() en lugar de b.start() funciona, pero llamarlo en un intervalo siempre me da el error. Se agradece cualquier ayuda

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!