Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

195
Vistas
JavaScript recursive setTimeout scope

This is working fine:

let timerId = setTimeout( function tick() {
  this.oneIteration(this.eventsQueue[counter], counter)
  counter++
  if( counter == this.eventsQueue.length ) {
    clearInterval(this.iteartionInterval)
    this.stopBtnClick()
  }
  timerId = setTimeout(tick.bind(this), this.timeoutDelay)
}.bind(this), 100)

My question is, how would it be possible to get rid of various

.bind(this)

making use of a more modern approach with arrow functions. A sample of this code is published here: link to codesandbox

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda