• 0

[JS] Returning the namespace of a function


Question

I am looking for a way to return the namespace of a function within an object in Javascript.

Example:

MyClass = {
	A:{
		 B:{
			   test : function(){
					alert(this.stackTrace);
			   }
		 }
	}
};

MyClass.A.B.test(); // displays "MyClass.A.B"

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.