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

197
Views
Why JavaScript throw error when missing semicolon in this situation?

Error Code

let a = 5
let b = 10
[a, b] = [b, a]; // ES6
console.log(a, b);

throw errro: Uncaught ReferenceError: b is not defined at :3:5

Running at Chrome Console, also throw error in Node.js

Valid Code

let a = 5;
let b = 10;
[a, b] = [b, a]; // ES6
console.log(a, b);

The difference is the semicolon in two let statements.

about 4 years ago · Juan Pablo Isaza
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!