I wanted to do the same, in order to assign several attributes to the instance of my class.
This approach might not help you since it uses one object argument instead of two arguments, still worth to mention:
class MyClass{
constructor(params={param1:3.1415, param2:'Hello'}){
//*assign* effectively destructures the params arg
Ojbect.assign(this,params);
}
}
Similarly your example would look like this:
function someFunc(params = {param1:'value', param2: 'value'}) {
console.log(Object.keys(params).length);
console.log(params['param1']);
}
Note that this approach requires your argument to be an object and that given one of the two arguments the other one will not be present in the default object.