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

184
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 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