With ES6, you can destroy argument objects as follows:
function myFun ( {val1, val2, val3} ) {
console.log("easy access to individual entries: ", val2);
}
But is it possible to name the entire object of the argument at the same time so that I can refer directly to this? I tried using the "arguments" object for this purpose, but with little success (I will save this specific problem for another question here if necessary)
source
share