by MathMonkeyMan · 2y ago · 0 comments
I do like writing Javascript that way, though:
function Thing(otherThing) {
const self = otherThing || {};
self.method1 = function () { /* ... */ };
// self. [...]
return self;
}
function main() {
// no `new`, no `this`
const thing = Thing();
// ...
}No comments yet.