var foo = function() {};
var f = new foo();
f.constructor;//function
f.constructor === foo;//true
function bar() {};
var b = new bar();
b.constructor; //bar()
b.constructor === bar;//true
Why
f.constructor give me function
b.constructor give me bar()
what’s the difference ?
var foo = function foo() {};
var f = new foo();
console.log(f.constructor); // foo
var fn = function(){};
console.log(fn.name); // an empty string
var fn = function fn(){};
console.log(fn.name); // fn