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

348
Visualizações
What is the syntax used in const { default: _ } = await import('lodash');?

I'm currently following the dynamic imports guide in Webpack documentation and came across this following example:

async function getComponent() {
  const element = document.createElement('div');
  const { default: _ } = await import('lodash');
  element.innerHTML = _.join(['Hello', 'webpack'], ' ');
  return element;
}
getComponent().then((component) => {
  document.body.appendChild(component);
});

Question 1: What is the syntax used in const { default: _ } = await import('lodash');?

I understand that { default: _ } is needed because of how Webpack import CommonJS modules. But what does it mean to have it on the left side of the assignment?

I tried to get the answer online and was fruitless after much effort. I am pretty sure this is unrelated to Webpack itself, but I don't really know how I should phrase my question to get the answer from Google instead of asking it here. So for my future improvement:

Question 2: How would you formulate this question to get an answer from the search engine?

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