我想检查一个对象是否扩展了另一个对象(真,假):
例子:
var BaseObject = function(object) {
this.name = object.name;
this.someFunction = object.someFunction;
this.someOtherProperty = object.someOtherProperty;
};
var ExtendingObject = new BaseObject({
name: "extention",
someFunction: function(value) { return value; },
someOtherProperty = "hi"
});
// some possible function
var extends = isExtending(BaseObject, ExtendingObject);
var isParentof = isParentOf(BaseObject, ExtendingObject);
underscore.js 是否提供这样的功能(我发现没有......)?
我怎样才能进行这样的检查?