Snippet

The following function returns two variables: a credentials object and a transport string.

function getEmailConfig() {
    let credentials = {
        userName: 'anthony',
        password: 'pass'
    };
    let transport = 'smtp';
    return { credentials, transport };
}

When this function returns, the destructuring assignment feature allows you to assign the return value to two different variables in a single operation, like so:

let { credentials, transport } = getEmailConfig();

A very nice feature in ES6.