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

187
Vistas
Why can let declare variables repeatedly?

Why can let declare variables repeatedly in the browser console?

I remember that I would have reported an error before. Is 21-year chrome based on that ECMA-specification?

let a=1
undefined

let a=12
undefined

navigator.userAgent
'Mozilla/5.0 (Windows NT 10.0; Win64; x64)
AppleWebKit/537.36 (KHTML, like Gecko) Chro
me/93.0.4577.82 Safari/537.36'

Here's a screenshot:

enter image description here

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

0

The console environment has a number of odd quirks. It's not like a standard <script> tag on the page.

One of the quirks is these. The way it used to be in Chrome was, re-declarations of variables with let was not permitted - you'd get the expected error that the re-declaration is invalid syntax. But as of Chrome 80 or so (spring 2020), it was changed to be permitted.

You still can't re-declare variables with let in a standard <script>, of course:

let foo = 5;
let foo = 10;

about 4 years ago · Juan Pablo Isaza Denunciar

0

You cannot redeclare a variable previously declared with let in strict mode. Please see: What's the difference between using "let" and "var"?.

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