Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

159
Visualizações
what is the meaning of ({ a } = b); in javascript?
let b = { a: 123123123 };
try {
  ({ a } = b); <<< what is the meaning of () 

} catch (error) {}
console.log({'a':a})

why this script work, what is the meaning of () in try-catch .

the { a } = b is wrong but ({ a } = b) is correct and the variable will go out of try-catch and give new value to a.

if there are a function in () may be a IIFE, if in expressions the () is a Grouping operator.and in my example,what is the meaning of ()

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

A pair of parenthesis force the contents to be treated as an expression instead of a statement.

This causes the { to be seen at the start of an object or dereferencing structure (the latter in this case) instead of a block.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda