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

108
Views
setInterval y cómo interactúa con los objetos

He notado que cuando uso setInterval() con objetos, acepta esto:

 setInterval(function(){auto1.increaseValue(s);}, auto1.interval);

Donde auto1 es un objeto de una clase. Sin embargo, el programa arroja un error cuando coloco un objeto o un objeto de una matriz de otro objeto dentro de la función. Ex.

 let index = this.arrayForItems.length-1; setInterval(function(){this.arrayForItems[index].increaseValue(s);header.innerHTML = s.value;}, this.arrayForItems[index].interval);
 setInterval(function(){this.item.increaseValue(s);header.innerHTML = s.value;}, this.item.interval);//Where item is the object inside object shop

Pero esto funciona.

 let index = this.arrayForItems.length-1; let referenceToPurchase = this.arrayForItems[index]; setInterval(function(){referenceToPurchase.increaseValue(s);header.innerHTML = s.value;}, referenceToPurchase.interval);

¿Por qué esto es tan?

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!