title: array as data member in a class javascript
body: <p>I am new one in object oriented javascript and trying to define a class, that have an array as a data member. this data member of class storing objects of an other class as an array.</p>
  
  <p>it will be more clear by this example</p>
  
  <pre><code>function classA(id, objB_01)
  {
  
      this.id = id;   // data member that store a simple value
      this.arrayname = objB_01  // How multiple instance of classB is stored in this array 
  
  
  }
  
  function classB( id, name, status)
  {
       this.id = id;
       this.name = name;
       this.status = status 
  }
  
  objB_01 = new classB("01", "john", "single");
  objB_02 = new classB("02", "smith" "single");
  objB_03 = new classB("03", "nina", "married");
  </code></pre>
  
  <p>now my question is how i can write <code>classA</code> so that single instance of <code>classA</code> hold an array that store mutiple object of <code>classB</code></p>
  
  <p>Something like this </p>
  
  <pre><code>objA = new classA("01",objB_01);
  objA.arrayname = objB_02;
  objA.arrayname = objB_03;
  </code></pre>
  
  <p>Now Finally <code>objA</code> contain one string and one array that store multiple objects of classB</p>
  
  <p>Please point me in the right direction </p>