Out of curiosity, is it possible to call two functions at once?
For example, here is some pseudo code:
// custom logging function:
function custom_log(string) {
console.log(string);
}
(console.log && custom_log)("Hello World.");
If it's possible how?
No, you can't say "here are two functions, here's one set of arguments, call them both with the same arguments". But you can pre-define the arguments in a variable and pass that to both functions, which is probably the most concise if you use object destructuring for your parameters:
You could also just create a helper function that iterates through an array of passed functions and calls them all: