title: Alternative to the 'let' keyword in a loop?
body: <p>I was having an issue where I was setting up a bunch of timeout calls and I wanted the timeout function to reference the element in the current loop.</p>
  
  <p>This is what the result looked like:</p>
  
  <pre><code>    var createTimedMessages = function(arr, collection){
          var timeLimit = 2000;
          for(var i = 0; i&lt;arr.length; i++){
              let el = arr[i];
              collection.push(el);
              $timeout(function removeElement(){
                  collection.removeMatch(el);
              }, timeLimit);
          }
      }
  </code></pre>
  
  <p>but I realized that this wouldn't work with some slightly older browsers because of lack of support for the let keyword. What is a good workaround?</p>
  
  <p>Note: This is in angular, hence the $timeout rather than setTimeout.</p>