var base = function() { };
base.prototype.doStuff = function() {
console.log(1);
};
var foo = Object.create(new base());
console.log(typeof foo); //object
foo.doStuff(); //1
I know there are some similar questions out there, but I couldn't find an answer to this one.
This works, but what if I want foo
to be of type function
so that I can add properties to its prototype? In other words, let it inherit the methods from the base
prototype and merge them with its own prototype?