I would like the below function to be more flexible and accept multiple callbacks to other functions if they are defined in the arguments.
$(function() {
Thanks to the spread operator now you can do something like this
function myFunction(...params) {
console.log(...params);
}
myFunction('Many arguments', 1, {two: 3}, ["four", 5]);
// to access one by one
function oneByOne(...params) {
params.map(param => {
console.log(param);
});
}
oneByOne('Many arguments', 1, {two: 3}, ["four", 5]);