title: How to write a function to double numbers and pass them as to an object
body: <pre><code>numbers = [1,2,3,4,5];
  
  function doubling(number) {
      number *= 2;
      return number;
  }
  
  obj = {};
  for (var i = 0; i &lt; numbers.length; i++)
      doubled = doubling(numbers[i]);
      obj[numbers[i]] = doubled;
      console.log(obj);
  </code></pre>
  
  <p>When I run my code, it prints '10' when what I want is for it to print {1:2, 2:4, 3:6, 4:8, 5:10}. Why does this happen?</p>