So I have a function like so:
function foo(a, b, c=0, d=10, e=false) {
// ...
}
I would like to call this function with specific inputs, but not necessarily need to list them in order in the input. So like:
foo("bar", "skurr", e=true);
I know in python you can call functions this way, but it seems there is another method I am unaware of for js.
I have tried inputting an object but that did not work since it just uses the object as the first parameter of the function.
foo({a: "bar", b: "skurr", e: true});
How do I call functions in this manner in JavaScript?