I am using inheritance in javascript. I am stuck in a situation where i have to check whether the First object inherited in the Second object. Example :
   function Parent(name)
   {
     var self = this;
     self.Name = name;
     self.Check = function() {
       for(var i = 0; i < ChildCollection.length ;i++)
       {
          //here i want to check whether self is the object which is
          //inherited in ChildCollection[i] 
          alert(true or false);
       }
     }
   }
   function Child(name)
   {
     var self = this;
     Child.prototype.constructor = Child;   
     self.Name = name;
   }
   $(function() {       
      var ChildCollection = new Array()
      for(var i = 1; i <= 2 ;i++)
      {
         Child.prototype = new Parent("TestParent_" + i);              
         var child = new Child("TestChild_" + i);
         ChildCollection.push(child);
      }             
       ChildCollection[1].Check();
    });  
In the above code i have created 2 classes Parent and Child. Child inherit Parent. I have create a global ChildCollection Array which contains all child objects. In parent class there is a check function which i want to create, it should loop through the ChildCollection array and check whether the current object means (self or this) is inherited or a part of current looped child object. 
To make very clear i called check on ChildCollection's second object i.e. ChildCollection[1].Check(). If i am clear or not wrong than first alert should be false and second alert should be true.
Please guid me to solve this issue and sorry if i am on totally on wrong track and please explain me what i am doing wrong ?
 
     
    