April 2018
Intermediate to advanced
284 pages
5h 46m
English
| Tip 29 | Access Object Properties with Destructuring |
In this tip, you’ll learn how to pull information out of objects and arrays quickly with destructuring.
In the previous tip, you learned how to create default parameters, which are a great addition to the language, but they still have one big problem: Parameters always have to be given in order. If you wanted to specify the third parameter but you didn’t care about the second, you’d still be forced to enter a value. Default parameters aren’t helpful if you want to skip a parameter.
What about situations where you need a large number of arguments for a function? What about situations where you know that the needs of a functions are likely to change? In JavaScript, most developers add extra arguments ...
Read now
Unlock full access