Answer the question
In order to leave comments, you need to log in
How to use a static method inside a class via this?
Can't access via this, only via Test.getName(). Is there an analogue of self like in php ?
class Test {
static getName() {
return 'Jack';
}
static getFullName() {
return `${ this.getName } Ivanov`
}
}
Answer the question
In order to leave comments, you need to log in
Everything works fine:
https://www.typescriptlang.org/play?#code/MYGwhgzh...
Probably because the parentheses in the method call were forgotten
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question