title: Else clause in for loop rewrites value in array
body: <p>For some reason, the else clause in my conditional rewrites the value in the array even when it finds a match. Any idea why this is happening? Code below:</p>
  
  <p><strong>controller.js</strong></p>
  
  <pre><code>    $scope.allAds = DummyAdService.dummyAds;
      $scope.allStatements = DummyStatementsService.dummyStatements;
  
      for(var i=0; i &lt; $scope.allStatements.length; i++) {
          var statement = $scope.allStatements[i];
          for(var j=0; j &lt; $scope.allAds.length; j++) {
              var ad = $scope.allAds[j];
              if(statement.statement.toLowerCase().indexOf(ad.tag) &gt; -1) {
                  statement.ad = ad.url;
              } else {
                  var randomAd = $scope.allAds[Math.floor(Math.random() * $scope.allAds.length)];
                  statement.ad = randomAd.url;
              }
          }
      };
  </code></pre>
  
  <p><strong>services.js</strong></p>
  
  <pre><code>function DummyStatement(id, accountId, reportId, timestamp, rating, statement, url) {
      this.id = id;
      this.accountId = accountId;
      this.reportId = reportId;
      this.timestamp = timestamp;
      this.rating = rating;
      this.statement = statement;
      this.url = url;
  }
  
  function DummyStatementsService(DummyAccountService) {
      this.dummyStatements = [
          new DummyStatement(1, 1, 1, 1449635098000, 'pos',
              'Time to visit my second home. Gym haha'),
          new DummyStatement(2, 1, 1, 1449615098000, 'pos',
              'Feeling so much better after 10 hours sleep'),
          new DummyStatement(3, 1, 1, 1440615028000, 'pos',
              'Excited about going to Thorpe Park tomorrow'),
       new DummyStatement(16, 2, 1, 1449635098000, 'neg',
              'What a terrible week it\'s been so far. Weekend can\'t come soon enough'),
          new DummyStatement(17, 2, 1, 1449615098000, 'neg',
              'Rain rain rain go away. We all want some sunshine'),
          new DummyStatement(18, 2, 1, 1440615028000, 'neg',
      ]
  }
  
  function DummyAd(id, tag, url) {
      this.id = id;
      this.tag = tag;
      this.url = url;
  }
  
  function DummyAdService() {
      this.dummyAds = [
          new DummyAd(1, "gym", "ad-gym.jpg"),
          new DummyAd(2, "sleep", "ad-sleep.jpg"),
          new DummyAd(3, "thorpe park", "ad-themepark.jpg"),
      ]
  }
  </code></pre>