I am trying to simulate multiple inheritance in JavaScript, so I need to find a way to obtain a list of conflicting method names for two JavaScript objects. Is it possible to generate a list of function names for two objects, and then find all of the function names that are the same between the two classes?
function base1(){
this.printStuff = function(){
return "Implemented by base1";
};
}
function base2(){
this.printStuff = function(){
return "Implemented by base2";
};
}
function getConflictingFunctionNames(object1, object2){
//get a list of conflicting function names between the two objects.
//to be implemented.
}
console.log(getConflictingFunctionNames(base1, base2)); //this should print ["printStuff"]