This question has already been answered:
How to call w_2_test() in w_1_test() ?
class TEST{ constructor(name){ this.name = name; } //методы w_1_test(){ w_2_test(); } w_2_test(){ console.log("LOG_ w_2_test()"); } } This question has already been answered:
How to call w_2_test() in w_1_test() ?
class TEST{ constructor(name){ this.name = name; } //методы w_1_test(){ w_2_test(); } w_2_test(){ console.log("LOG_ w_2_test()"); } } A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .
To access class methods within a class, you need to use the this keyword . That is, in your situation the call will look like this:
w_1_test(){ this.w_2_test(); } I would like to recommend you a good course from Ilya Kantor https://learn.javascript.ru/es-class . For beginners, what you need!
Source: https://ru.stackoverflow.com/questions/914785/
All Articles