Skip to main content
InterviewHubPRO
Section Overview
Q369

Question 369 of 536

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

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

What is destructuring aliases

senior LevelCode ExampleAsync & PromisesEvent LoopHTTP & REST APIs

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;