function isFunction (functionToCheck) {
  if (typeof functionToCheck === "undefined")
  {
    return false;
  } else if (functionToCheck === null) {
    return false;
  } else {
    var getType = {};
    var functionType = getType.toString.call(functionToCheck);
    return functionToCheck && (functionType === '[object Function]' || functionType === '[object AsyncFunction]');
  }
}
Test if the passed argument is a function