Destructuring is a new feature of JS that allows you to break apart stuff into variables.


In one line, you can take any JS object and break it into it’s constituted variables. These are sometimes referred to as JS options objects.  And they can be used for optional parameters. Like in this jQuery.ajax function.

    url: "",
    success: function (data) {console.log(data);},
    cache: true,
    timeout: 500

Here is an example of how to call a method with option objects.


No if you wanted to make a property, like species, optional, one way would be to do it like this.


But a better way, would be to set the options right int the constructor of the method itself.


Pretty slick. Thanks mpj for the great video explaining how all this works.