code: function getFnName(fn) {
          var f = typeof fn == 'function',
              s = f && ((fn.name && ['', fn.name]) || fn.toString().match(/function ([^\(]+)/));
  
          return (!f && 'not a function') || (s && s[1] || 'anonymous');
      }
docs: Get function name
  https://gist.github.com/dfkaye/6384439