Is there any way I could write a function in order to call it in both ways like this?
I know how to write both params structures in the function but I would like to know how to validate both params structures in a single function.
functionToCall(1, 'value', true);
and
functionToCall({
param1: 1,
param2: 'value',
param3: true
});