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

351
Views
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
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!