Articles with the tag #destructuring:

How to use keyword arguments in JavaScript

Passing an Object named options to a function instead of separate arguments is one of the oldest tricks in the book, by also assigning an empty object by default you also reduce the amount of if statements needed in the top of the function. But a year ago I learned how combining this with object deconstruction made it so much more elegant. …read more

Why default exports are bad

Import statements come in a lot of different flavors in JavaScript and where there is variation some of the options are often better than others. For import statements we want to easily understand which parts of a module we are going to use and also easily get an overview of where those parts are being used throughout our projects. …read more