I understand that, using ES6 syntax, a function can be made that takes an object as a parameter and that parameter can have a default value, like so:
functio
Probably not as clean as you're looking for, but you can do this instead
function exampleFunction(objParams) {
const defParams = { val1: 1, val2: 2 };
const finalParams = { ...defParams, ...objParams }
// final params takes the default params and overwrites any common properties with incoming params
// ...
}