title: multiple ajax call to single function javascript
body: <p>I have 3 ajax call. Data from each ajax call is passed to <code>john_doe();</code></p>
  
  <p><strong>Call 1</strong></p>
  
  <pre><code>$.ajax({
          url: url1,
          dataType: "JSON",
          type: "GET",
        }).success(function(data1){
  
      john_doe(data1);
  });
  </code></pre>
  
  <p><strong>Call 2</strong></p>
  
  <pre><code>$.ajax({
          url: url2,
          dataType: "JSON",
          type: "GET",
        }).success(function(data2){
  
      john_doe(data2);
  });
  </code></pre>
  
  <p><strong>Call 3</strong></p>
  
  <pre><code>$.ajax({
          url: url3,
          dataType: "JSON",
          type: "GET",
        }).success(function(data3){
  
      john_doe(data3);
  });
  </code></pre>
  
  <p><strong>Main function</strong></p>
  
  <pre><code>function john_doe(param){
  console.log(param); //Print data from all three ajax call.
  }
  </code></pre>
  
  <p>How to separate data1, data2 and data3 in john_doe function? because I need to carry out arithmetic operation.</p>
  
  <p>Currently,</p>
  
  <p><strong>Input</strong></p>
  
  <pre><code>data1 = one,two,three
  data2 = four
  data3 = five
  </code></pre>
  
  <p><strong>Output</strong></p>
  
  <p>console.log(param) would give output as</p>
  
  <pre><code>one
  four
  five
  </code></pre>
  
  <p><strong>I want output as</strong></p>
  
  <pre><code>console.log(param[0])
  console.log(param[1])
  console.log(param[2])
  
  param[0] containing one,two,three
  param[1] containing four
  param[2] containing five
  </code></pre>
  
  <p>I dont have control over the data. How to access data1, data2 and data3 separately?</p>