What is destructuring, and what forms does it come in?
Destructuring is a syntax that pulls values out of an object or an array and binds them to names in a single step. It is the opposite of building an object out of named variables, and it replaces a lot of repeated property access.
There are four forms that you should be able to name. Object destructuring uses curly braces and matches property names. Array destructuring uses square brackets and matches by position. Renaming assigns to a different local name using a colon. Defaults fill in a value when the property is missing, using an equals sign. The rest element collects everything that you did not name, using three dots.
Nesting works as well. If you destructure an object whose property is itself an object, you can go deeper by nesting another pattern inside the first one. That lets you reach a nested value in a single statement, without a chain of intermediate variables.
The main benefit is that destructuring separates the shape of the data from the code that uses it. When a function takes an options object, destructuring the parameter makes the accepted keys obvious to a reader and to a type checker, and it means that the body of the function never repeats the options prefix. It also gives you a natural place to put defaults, which is usually the only reason that the function signature looked complicated in the first place.