A possible solution is to use the arguments
variable (which is a local variable accessible within all functions and contains an entry for each argument passed to that function). So you can do:
const args = Array.prototype.slice.call(arguments, 0, arguments.length);
const argTypes = args.map(e => typeof e);
console.log(argTypes);
This prints:
["string", "number"]