function F() {
return function() {
return {};
}
}
var f = new F();
f instanceof F; // returns false
As far as I understand, if I want instanceof to work, I need to return this from the constructor. But I want the constructor to return a function, and I cannot assign to this.
So, is this really impossible or can it be done somehow, for f = new F() to return a function and still f instanceof F to return true?
Only works in the browsers with
__proto__