I understand that JS has a liberal ‘arguments optional’ type approach when it comes to function calls.
That is assume one had a function defined as:
function example(a, b, c) {
}
Of course, in the end it all depends on what the function ultimately ‘does’-- However example calls of the like:
example();
example(1);
example(1, 1);
example(1, 1, “something”);
At least would not throw any errors. This ‘overloading’ is a great feature of the language to have. However, given that, out of curiosity, is there anyway I can thus make a function call where I can somehow ‘only’ feed/affect, say prop ‘c’ ?
i.e.
example(, ,“something”);
And preclude any changes to the first two, or must I provide some value and then put in handlers for the ‘no change’ case. I would understand how to do this with handlers, and I imagine this is the only way but I didn’t know if there was any ‘trick’ to do this… It would actually make a lot of sense, I think.