I'm trying out instanceof
operator. I tried out something like this.
function f(){ return f; }
new f() instanceof f;
// false
Why this came out to be false
, when these are true
function f(){ return f; }
new f() instanceof Function;
// true
function f(){ return f; }
new f() instanceof Object;
//true
When tried to save this to a variable still resulted same
function f(){ return f; }
var n = new f();
n instanceof f;
// false
n();
// function f()
n() instanceof f;
// false
n instanceof Function // true
n() instanceof Function // true
Why return f;
statement have changed everything?
What did return f
did to cause this behavior?