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

166
Vistas
Need clarity regarding LET and temporal dead zone
console.log(a);

let a = 10;
var b = 100;

Output:
script.js:1 Uncaught ReferenceError: Cannot access 'a' before initialization

let a;
console.log(a);
a = 10;
console.log(a);

Output:-
undefined
10

Doubt:- While performing the first console.log(a), a is in temporal dead zone since it hasn't been initialized. So why is it not throwing any error and printing undefined?

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

0

Because you have defined the variable but not the content

in the first example the variable is defined after is called so it throw an error

in the second case the variable is defined but it's content doesn't. So the first console.log print the content undefined

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