Может быть, вспомогательная функция, как это. Но если вы видите, что регулярно используете такой синтаксис, вам, вероятно, следует переключиться на Typescript.
function check(caller_args, ...types) {
if(!types.every((type, index) => {
if(typeof type === 'string')
return typeof caller_args[index] === type
return caller_args[index] instanceof type;
})) throw Error("Illegal argument given");
}
function abc(name, id, bla) {
check(arguments, "string", "number", MyClass)
// code
}