Array-based parameters check
Define the functions that correspond to a given argument configuration separately:

const processStringNumber = (string, number) =&gt; console.log(number + ' is a number')
const processStringString= (string, string2) =&gt; console.log(string2+ ' is a string')


Put the argument configurations and the corresponding functions in a data structure:

const processingObj = [
  {
    argsTypes: ['string', 'number'],
    process: processStringNumber
  },
  {
    argsTypes: ['string', 'string'],
    process: processStringString
  }
]


Write a helper that does the checks and dispatches the corresponding function:

//Retrieve the types of an array of args (can have different implementations)
const getTypes = (args) =&gt; args.map((arg) =&gt; typeof arg)

//Calls the appropriate function from 'processingObj'
const process = (args, processingObj) =&gt;
  processingObj
    .find((process) =&gt; _.isEqual(process.argsTypes, getTypes(args)))
    .process(...args)


Usage: 

process(["aaa", 1], processingObj) // 1 is a number
process(["aaa", "aaa"], processingObj) // aaa is a string


Here is also an ES5 version (via Babel)