the final argument ...message collapses all remaining destructured arguments into a single array, which we can simply join(' ') into a single string. This also works for objects:
let    obj    =    {
    foo:    'foo!',
    bar:    'bar!',
    baz:    'baz!'
};
//    assign    keys    to    local    variables    with    same    names
let    {foo,    baz}    =    obj;

//    Note    that    we    "skipped"    #bar
console.log(foo,    baz);    //    foo!    baz!
Now,    you    can    do    this    instead:    
function    (a,    b,    ...args)    {
//    #args    is    already    an    Array!
}

results matching ""

    No results matching ""