Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Options: --debug --source-maps
- var f = a => {
- return a + 1;
- };
- // Classic javascript prototypical style
- function BaseTest(a) {
- this.a = a;
- }
- BaseTest.prototype.go = function(a) {
- this.a = a;
- }
- // ES6 stype - extending a classical prototypical class
- class Test extends BaseTest {
- constructor(a) {
- super(a);
- }
- dostuff(f) {
- return f + this.a;
- }
- static green() {
- return "green";
- }
- }
- f = new Test(22);
- console.log(f.a);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement