Is there a way to retrieve the name of the current method within an instance method of a class in Typescript?
(Pseudocode, it's not functional):
class Foo {
bar() {
console.log(something); //what should something be?
}
}
new Foo().bar();
I'm looking for 'something' to return 'bar'. I know that this
can provide me with the class, and I could potentially extract the class and its properties from it, but I am uncertain on how to access 'this function' (specifically, the method bar rather than the class Foo).
I have come across multiple questions regarding determining the class name, etc. however none seem to address retrieving the current method name.