var parent = {
	 method1 : function() {
	 }
};

var child = (function(parentObj) {
    var F = function(){
        this.method2 = function() {
        };
    };
    F.prototype = parentObj;
    return (new F());
})(parent);

console.log("method1" in child);// true
console.log("method2" in child);// true
console.log(child.hasOwnProperty("method1") );// false
console.log(child.hasOwnProperty("method2") );//true

초 간단 샘플예제이다.
객체에  메소드가 존재하는지 확인하는 방법은 hasOwnProperty 메소드와 in 연산자로 확인할수 있다.
다만 hasOwnProperty는 객체 자신의 메소드 인지 확인하는 것이고
in 연산자는 상속계통을 다 뒤져서 존재하는지 확인하는 메소드 이다.
posted by 뚱2