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

386
Vistas
Why "let = 13" don't throw an error in JavaScript? (Chrome console + nodejs)

"var, let, const" are keywords in JS, you can not name your variables with keywords. but if you try to declare a variable named "let", it will work and throw no error.

e.g.

const = 13; //Uncaught SyntaxError: Unexpected token '='
var = 13; //Uncaught SyntaxError: Unexpected token '='
const let = 123; //Uncaught SyntaxError: let is disallowed as a lexically bound name
let let = 13; //Uncaught SyntaxError: let is disallowed as a lexically bound name
x = 13; //works good, so far so good

let = 13; //works fine,
++let // returns 14

at first, I thought because "let" is a new keyword (ES2015) so it's backward compatibility or something like that, but you can't do it with the const keyword or any JS keyword

anyone knows why?

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