Created
April 20, 2020 16:43
-
-
Save martinadamsdev/8fae91c1000440645bebb93ea276df28 to your computer and use it in GitHub Desktop.
This file contains 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
// class Test { | |
// constructor(a, b) { | |
// this.a = 0 | |
// this.b = 1 | |
// } | |
// | |
// say() { | |
// console.log('hello world!') | |
// } | |
// } | |
"use strict"; | |
const Test = (function() { | |
function Test(a, b) { | |
this.a = a; | |
this.b = b; | |
} | |
let _proto = Test.prototype; | |
_proto.say = function say() { | |
console.log("hello world!"); | |
}; | |
return Test; | |
})(); | |
let a = new Test(3, 9) | |
console.log(a); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment