title: Why angular.forEach context?
body: <p>I was analyzing the <a href="https://docs.angularjs.org/api/ng/function/angular.forEach"><code>angular.forEach</code></a> function:</p>
  
  <p>Here is the code of <code>angular.forEach</code>:</p>
  
  <pre><code>var values = {name: 'misko', gender: 'male'};
  var log = [];
  
  angular.forEach(values, function(value, key) {
    this.push(key + ': ' + value);
  }, log);
  
  expect(log).toEqual(['name: misko', 'gender: male']);
  </code></pre>
  
  <p>The description of context is:</p>
  
  <blockquote>
    <p>Object to become context (this) for the iterator function.</p>
  </blockquote>
  
  <p>I came up with some questions:</p>
  
  <p>Why use and when is useful the parameter <strong>context</strong>?!</p>
  
  <p>Why use <strong>this</strong> instead the <strong>log variable</strong>?</p>