72
rated 0 times
[
79]
[
7]
/ answers: 1 / hits: 105312
/ 7 Years ago, wed, april 26, 2017, 12:00:00
Why am I getting the error: Uncaught TypeError: self.myTest is not a function? How do I call a method from within another method in a javascript class?
class MyClass {
myTest() {
console.log('it works');
}
runMyTest() {
self.myTest();
}
}
var myClass = new MyClass();
myClass.runMyTest();
More From » ecmascript-6