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

113
Vistas
Can you call an IIFE after it has need invoked already without reloading the page?

Is it possible to call a IIFE function again without reloading the page? Similar to the way you call a regular function.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Not unless the IIFE itself is inside a function, and you trigger that function itself again, eg

const fn = () => {
  (() => {
    // do stuff
  })();
};
fn();
fn();

Which is weird.

If you want to be able to call something more than once, you should put into a variable so it can be referenced again - a regular named function

const fn = () => {
  // do stuff
};
fn();
fn();

An IIFE is designed to be the sort of thing that (usually) runs exactly once. If you want to run something multiple times, an IIFE is not the right tool for the job.

about 4 years ago · Juan Pablo Isaza Denunciar
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