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

202
Vistas
Calling a promise function after delay

I am trying to make a promise function repeatedly call itself after interval

The promise function:

function bd() {
  return new Promise((resolve, reject) => {
        // gets message_bd
        resolve(message_bd)     
    })
  }

I try to call it repeatedly every 3 seconds like so:

var interval = setInterval(function(){
    bd().then((message_bd) => {
      console.log(message_bd)
  },3000);

the bd() gets called after the first 3 seconds and the message_bd gets resolved (everything's working), but then I get this error as the second 3 seconds finish:

 bd().then((message_bd) => {
    ^

TypeError: bd is not a function

Would appreciate any help :)

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