JSFiddle - React, Tailwind, and code Playground
JavaScript
const Class = function(x){
this.x = x;
this.func = function(){
return this.x;
}
this.funk = this.func;
this.funq = function(){
return this.func();
}
}
const func = function(s){
return new arguments.callee.createClass(s);
}
Object.defineProperty(func, "createClass", {
value: Class,
enumerable: false,
configurable: false,
writable: false
});
Object.defineProperty(func.prototype, "createClass", {
value: Class,
enumerable: false,
configurable: false,
writable: false
});
alert(func(2).func())
//alert(func(2).funk())