Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
hokkos
on July 23, 2015
|
parent
|
context
|
favorite
| on:
ES6 in Depth: Classes
Or use :
myMethod = (arg) => {return this.value + arg;}
With es7.classProperties in babel.
https://babeljs.io/docs/usage/experimental/
karcass
on July 23, 2015
|
next
[–]
Or more tersely:
myMethod = arg => this.value + arg;
Cshelton
on July 23, 2015
|
prev
[–]
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: