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

183
Views
While destructuring array in javascript redeclaration error shown?

enter image description here

Same code is run on vs code and i get the values but while checking in browser console. Above error is shown. Please help to solve the query.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Prior Chrome 92, it was not possible to redeclare the same const in the console in different executions. https://developer.chrome.com/blog/new-in-devtools-92/#const-redeclaration

I think you could just update your chrome and your code will work (I just tried it) ;)

about 4 years ago · Juan Pablo Isaza Report

0

NOTE: This is not an answer, just a suggestion.

when running code in the browser, please run it inside a function and then call that function. This will help you avoid scope issues which might be the case in your question.

I am adding an example here

function test(){
    const value = [1, 2, 3, 4];
    const [a, b, c] = value;
    console.log(a, b, c);
}
test()

This is what you should try to follow. Benefits of following this:

  • can be called multiple times without writing the whole code every time
  • can pass arguments in the function to make it dynamic
about 4 years ago · Juan Pablo Isaza Report
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!