4

With ES6, one can destructure argument objects like this:

function myFun ( {val1, val2, val3} ) {
    console.log("easy access to individual entries: ", val2);
}

But is it also possible to simultaneously name the whole argument object, such that I can refer to this directly as well? I have tried using the 'arguments' object for this purpose, but with little success (that particular issue I'll save for another question here, if need be)

Quentin Roy
  • 7,677
  • 2
  • 32
  • 50

0 Answers0