FrontendDeveloper.in

JavaScript question detail

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.

const obj = { x: 1 };
// Grabs obj.x as { otherName }
const { x: otherName } = obj;
Back to all JavaScript questions
Get LinkedIn Premium at Rs 399