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

178
Vistas
Const variable issue in function in Safari

I was investigating one problem where content of web page is not getting loaded in Safari, on further investigation it was found that it is because of variable scope (const vs var).

if (1 == 1) {
  const a = 1;

  function f() {
    console.log(a);
  }
  f();
}

Error:

Can't find variable: a

With variable type as const was getting error in Safari browser and all browser in Iphone, And it was working in all other browser except Safari on desktop.

After changing it to var it has solved the issue. But still not able to find the justification why with const it was not working in Safari.

What is correct behaviour for const?

about 4 years ago · Santiago Trujillo
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