title: Confusion on how to use functions in javascript
body: <p>This is what I am trying to implement.</p>
  
  <pre><code>var globalVar = [];
  var tomakeJson = JSON.Stringify(globalVar);
  window.load = function grpwrk() {
     hdWork: function() {
          // return somefatherwork;
       };
     asstWork: function() {
         // return somemotherWork;
       };
  };
  </code></pre>
  
  <p>To call a function</p>
  
  <pre><code> globalVar.push(familyWork(hdWork()));
   globalVar.push(familyWork(asstWork()));
  </code></pre>
  
  <p>Then <code>tomakeJson</code> is send to backend server and gets stored in NoSQL.</p>
  
  <p>Is this implementation right? Is there any other way to use this type of function?</p>