title: create a json object with own key and value using AngularJS
body: <p>i have some data in array. using these data to create a json object as my own key and my value. Here is my array</p>
  
  <pre><code>$scope.keyValue = ["personal^2", "Small^5", "Medium^7", "Large^9", "ExtraLarge^12"]
  </code></pre>
  
  <p>i want to push the key and value in another object. I tried to get the output like below.</p>
  
  <pre><code> {
      "Personal" : 2
      "Small" : 5
      "Medium" : 7
      "Large" : 9
      "Extra Large" : 12
   }
  </code></pre>
  
  <p>Here my code.</p>
  
  <pre><code>var keyValue = ["personal^2", "Small^5", "Medium^7", "Large^9", "ExtraLarge^12"];
  tempdata = [];
  for(var i=0;i&lt;keyValue.length;i++) {
      var key = keyValue[i].substr(0, keyValue[i].indexOf("^"));
      var value = keyValue[i].substr(keyValue[i].indexOf("^")+1);
      tempdata.push({key : value});        
  }
  $scope.array = tempdata;
  </code></pre>