Destructuring & Spread Operator
How can you use destructuring with renaming in objects?
You can use destructuring with renaming in objects using the syntax `const { old: new } = obj;`. This syntax extracts the property named 'old' from the object and assigns its value to a new variable named 'new'. This is useful when you want to extract a property but the property name isn't a suitable variable name, when it conflicts with existing variables, or when you want a more descriptive variable name. For example, `const { userId: id } = user;` would take the userId property from the user object and create a variable named id with its value. Note that this syntax can be a bit confusing because the colon looks similar to object literal syntax, but the meaning is reversed: in object literals, `{ key: value }` assigns a value to a key, while in destructuring, `{ key: newName }` assigns the value of the key to a variable named newName. You can also combine renaming with default values: `const { old: new = defaultValue } = obj;`.