Skip to content

Instantly share code, notes, and snippets.

@bendrucker
Created June 1, 2015 22:57
Show Gist options
  • Select an option

  • Save bendrucker/3610c5afd28fe3476a3b to your computer and use it in GitHub Desktop.

Select an option

Save bendrucker/3610c5afd28fe3476a3b to your computer and use it in GitHub Desktop.
fn.prototype
// equivalent
// apply
function MyEl () {
BaseElement.apply(this, arguments)
}
// call
function MyEl (el) {
BaseElememt.call(this, el)
}
// es6 class/extend
class MyEl extends BaseElement {
constructor () {
// implicit if ctor is omitted
super()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment