title: create new array with index key value JSON in Javascript
body: <p>I have a JSON like this:</p>
  
  <pre><code>{
    "codeA": {
      "USD": 125.648
    },
    "codeB": {
      "USD": 654.547
    },
    "codeC": {
      "USD": 132.45
    }
  }
  </code></pre>
  
  <p>I populate into new array after API calling success:</p>
  
  <pre><code>then(function successCallback(response) {
    var responsePrice = response.data; 
  }
  </code></pre>
  
  <p>I want to populate an array like this:</p>
  
  <pre><code>var pricesCode = 
    pricesCode[0].code = codeA;
    pricesCode[0].currency = USD;
    pricesCode[0].price = 125.648;
  </code></pre>
  
  <p>I am using the jQuery <code>$.each</code> function </p>
  
  <pre><code>$.each(responsePrice, function(key, value) {
      priceCode.push({
          currency: key,
          price: value
      });
  });
  console.log(priceCode);
  </code></pre>
  
  <p>but the result I am getting is:</p>
  
  <pre><code> priceCode[currency[0] = codeA, price[0] = USD, object undefined]
  </code></pre>
  
  <p>Can someone show me right code or similar question as asked before. Many thanks.</p>