title: Returning key/value pair in javascript
body: <p>I am writing a javascript program, whhich requires to store the original value of array of numbers and the doubled values in a key/value pair. I am beginner in javascript. Here is the program:</p>
  
  <pre><code>var Num=[2,10,30,50,100];
  var obj = {};
  
  function my_arr(N)  
  {
      original_num = N
      return original_num;
  
  }
  
  
  
  function doubling(N_doubled)
  {
     doubled_number = my_arr(N_doubled);
  
     return doubled_number * 2;
  }   
  
  
  for(var i=0; i&lt; Num.length; i++)
   {
      var original_value = my_arr(Num[i]);
      console.log(original_value);
      var doubled_value = doubling(Num[i]);
      obj = {original_value : doubled_value};
  console.log(obj);
  }
  </code></pre>
  
  <p>The program reads the content of an array in a function, then, in another function, doubles the value.</p>
  
  <p>My program produces the following output:</p>
  
  <pre><code>2
  { original_value: 4 }
  10
  { original_value: 20 }
  30
  { original_value: 60 }
  50
  { original_value: 100 }
  100
  { original_value: 200 }
  </code></pre>
  
  <p>The output which I am looking for is like this:</p>
  
  <pre><code>{2:4, 10:20,30:60,50:100, 100:200}
  </code></pre>
  
  <p>What's the mistake I am doing?</p>
  
  <p>Thanks.</p>