Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Or use :

  myMethod = (arg) => {return this.value + arg;}
With es7.classProperties in babel. https://babeljs.io/docs/usage/experimental/


Or more tersely:

  myMethod = arg => this.value + arg;


or depending on what you are doing in that method, use a get myProperty() {//do stuff and return prop}




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: