title: foreach key and value input parameters javascript
body: <p>I am kind of confused with the foreach loop syntax with the key and value pairs. So I have an object and a foreach loop something like the example below. In my case, what will be my object, value, and key? and what do I need to do if I want to change the name Canada to China? </p>
  
  <p>Array</p>
  
  <pre><code> $scope.tempData = [];
  </code></pre>
  
  <p>variables: </p>
  
  <pre><code>var data = [{name: "Kevin", country: "Canada"}, {name:"Bob", country: "Spain"}];
  
  
       $scope.editedDetails = function () {
  
             angular.forEach(object,
       function(value, key) { 
  
       });
  
      };
  </code></pre>