Is there a JavaScript equivalent of Java\'s class.getName()?
class.getName()
Use constructor.name when you can, and regex function when I can't.
constructor.name
Function.prototype.getName = function(){ if (typeof this.name != 'undefined') return this.name; else return /function (.+)\(/.exec(this.toString())[1]; };