When destructuring you can also provide default values
just assign a default value, like so a=1
for a missing value
in an object
if the value is undefined
also a string works with defaults
Required Knowledge
- `const` declaration (Block scope)
- array (Destructuring)
- object (Destructuring)
Related Katas
Destructuring
- array
- string
- object
- defaults
- parameters
- assign
Difficulty Level
BEGINNER
First Published
31 March 2015
Stats
5 tests to solve