code: function functionName(fn) {
    if (Function.prototype.name === undefined) {
      var funcNameRegex = /function\s([^(]{1,})\(/;
      var results = (funcNameRegex).exec((fn).toString());
      return (results && results.length > 1) ? results[1].trim() : "";
    }
    else if (fn.prototype === undefined) {
      return fn.constructor.name;
    }
    else {
      return fn.prototype.constructor.name;
    }
  }
docs: Polyfill to get the name of a function in IE9