Destructuring

    We can extract multiple values from an object or array and assign them to variables simultaneously.

    Destructuring objects

    Destructuring arrays

    Destructuring function arguments

    Advanced destructuring

    We can also nest and rename destructured variables and supply default values.

    The rest syntax ... collects remaining values. Rest is roughly the inverse of spread.