オブジェクトが別のオブジェクトを拡張するかどうかを確認したい (true、false):
例:
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 はそのような機能を提供していますか?
どうすればそのようなチェックを実行できますか?