Skip to content

Instantly share code, notes, and snippets.

@lukehedger
Created March 9, 2016 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukehedger/be084e0163a146f8ef45 to your computer and use it in GitHub Desktop.
Save lukehedger/be084e0163a146f8ef45 to your computer and use it in GitHub Desktop.
Just playing around with ES6 Classes
class Klass {
constructor() {
console.log('hello class!')
}
static util(a, b) {
return a + b
}
render() {
console.log('render')
}
}
const klass = new Klass()
klass.render()
// can't call klass.util() as it is a static prop of Klass
const utilCall = Klass.util(1, 2)
console.log(utilCall)