Created
June 1, 2015 22:57
-
-
Save bendrucker/3610c5afd28fe3476a3b to your computer and use it in GitHub Desktop.
fn.prototype
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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