InterviewHubPRO
Section Overview
Q369

Question 369 of 521

Part 6: Async Internals, Memory, Microtasks & Web APIs (329 - 403)

71%
JavaScript Internals (521 Qs)•Part 6: Async Internals, Memory, Microtasks & Web APIs (329 - 403)

What is destructuring aliases

Sometimes you would like to have a destructured variable with a different name than the property name. In that case, you'll use a : newName to specify a name for the variable. This process is called destructuring aliases.

javascript
  const obj = { x: 1 };
  // Grabs obj.x as { otherName }
  const { x: otherName } = obj;