Tip 33 | Reduce Complexity with Arrow Functions |
In this tip, youâll learn how to use arrow functions to destructure arguments, return objects, and construct higher-order functions.
You explored arrow functions once in Tip 20, â Simplify Looping with Arrow Functions â. Itâs time to take a deeper dive.
As a reminder, arrow functions allow you to remove extraneous information, such as the function declaration, parentheses, return statements, even curly braces. Now youâre going to see how to handle a few more concepts that youâve just learned, such as destructuring. Youâll also get an introduction to new ideas that youâll explore further in future tips.
Letâs begin with destructuring. Youâre going to take an object that has a ...
Get Simplifying JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.