I'm trying to call a class method in my class form a neighboring method as shown in the example below.
import blah from './blaha';
export default class myclass{
  constructor(con) {
    this.config = con;
  }
  async meth1(paramA) {
    //do_stuff...
  }
    meth2(paramB) {
     //attempt to call meth1()
  }
}
I would like to call a method from within a different method using es6 class styles.
Use this
import blah from './blaha';
export default class myclass{
  constructor(con) {
    this.config = con;
  }
  async meth1(paramA) {
    //do_stuff...
  }
  meth2(paramB) {
     this.meth1()
  }
}
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With