Assign object property values to new variables while destructuring
for simple objects
use a colon after the property name, like so propertyName: newName
assign a new name and give it a default value using = <default value>
for function parameter names
do it the same way, with a colon behind it
giving it a default value is possible too, like above
Required Knowledge
- basics (Arrow functions)
- `const` declaration (Block scope)
- array (Destructuring)
- object (Destructuring)
- defaults (Destructuring)
Related Katas
Destructuring
- array
- string
- object
- defaults
- parameters
- assign
Difficulty Level
INTERMEDIATE
First Published
2 April 2015
Stats
4 tests to solve