title: Add property/index to each element in an array
body: <p>I call a webservice that returns an array of objects:</p>
  
  <pre><code>$.ajax({
    dataType: "json",
    url: "WebServices/FetchMenu.aspx?P=0&amp;L=2&amp;mt=1",
    //data: data,
    success: function (data) {
      var foo = data;
    }
  });
  </code></pre>
  
  <p>This is the response:</p>
  
  <pre><code>[
      {
          color: "red",
          value: "#f00"
      },
      {
          color: "green",
          value: "#0f0"
      },
      {
          color: "blue",
          value: "#00f"
      },
      {
          color: "cyan",
          value: "#0ff"
      }
  ]
  </code></pre>
  
  <p>I want add a property <code>row_number</code> to each element which contains the current index of the element in the array.</p>
  
  <p>I need this because I am changing the order of the elements later on but want to be able to identify the original position of an element.</p>