Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

385
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!