title: pass argument to the parent class in javascript modular pattern
body: <p>i have made two classes, which is person - the parent class and a student class - the child class. i am trying to implement inheritance. also i am trying to implement it in modular pattern. but its not getting properly. for the code block please check below.</p>
  
  <p><strong>Person.js</strong></p>
  
  <pre><code>var Person = function() {
  
      var details, constructor, getDetailsByAttribute, setDetailsByAttribute, setDetails, getDetails, clearDetails;
  
      clearDetails = function()   {
          details = {
              uid : '',
              name : '',
              email : ''
          };
      };
  
      getDetailsByAttribute = function(attr)  {
          return details[attr];
      };
  
      setDetailsByAttribute = function(key, value)    {
          if(details.hasOwnProperty(key)) {
              details[key] = value;
          }else   {
              console.log('invalid key');
          }
      };
  
      setDetails = function(param)    {
          clearDetails();
          for(var attr in param)  {
              if(details.hasOwnProperty(attr))    {
                  details[attr] = param[attr];
              }
          }
      };
  
      getDetails = function() {
          return details;
      };
  
      /**
       * During object creation;
       */
      if(arguments.length &gt;= 1)   {
          //clearDetails();
          setDetails(arguments[0]);
      }
  
      return {
          getDetailsByAttribute : function(attr)  {
              return getDetailsByAttribute(attr);
          },
  
          setDetailsByAttribute : function(key, value)    {
              setDetailsByAttribute(key, value);
          },
  
          setDetails : function(params)   {
              setDetails(params);
          },
  
          getDetails : function() {
              return getDetails();
          },
  
          clearDetails : function()   {
              clearDetails();
          }
      };
  };
  </code></pre>
  
  <p><strong>Student.js</strong></p>
  
  <pre><code>var Student = function()    {
      Person.call(this,arguments);
  };
  
  Student.prototype = new Person();
  </code></pre>
  
  <p><strong>index.html</strong></p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;script type="text/javascript" src="modules/Person.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="modules/Student.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript"&gt;
              var person1, person2, person3, student1;
  
              person1 = new Person({
                  uid : 5225,
                  name : 'jaison',
                  email : 'jaison@jaison.com'
              });
  
              person2 = new Person({
                  uid : 5222,
                  name : 'jatin',
                  email : 'jatin@jatin.com'
              });
  
              person3 = new Person();
              person3.setDetails({
                  uid : 5221,
                  name : 'sarath',
                  email : 'sarath@sarath.com'
              });
              person3.setDetailsByAttribute('name', 'sarath');
  
              student1 = new Student({
                  uid : 5221,
                  name : 'sachin',
                  email : 'sachin@sachin.com'
              });
  
              console.log('person 1 : ',person1.getDetails());
              console.log('person 2 : ',person2.getDetails());
              console.log('person 3 : ',person3.getDetails());
              console.log('student 1 : ',student1.getDetails());
              //console.log(student1.get);
  
          &lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>