<commit_before>(function(){
  var app = angular.module('trudiedo', []);
  app.filter('escape', function() {
    return window.encodeURIComponent;
  }); 
  app.controller('DosController', function() {
    this.dos = dos;   
    this.theNewDo = {};
    this.tagArray = [];
    for (var i=0;i< dos.length; i++){
      this.tagArray[i] = ""; 
    }

    this.newDo = function(theNewDo){
      theNewDo.date = Date.now();
      theNewDo.tags = [];
      this.dos.push(theNewDo);
      this.theNewDo = {};
    };

    this.addTag = function(index, newTag) {
      // check for duplicate tags as we don't allow this. 
      for (var i=0;this.dos[index].tags.length; i++){
        if(newTag === this.dos[index].tags[i]){
          this.tagArray[index] = "";
          return; 
        } 
      }<commit_msg>fixed javascript forever for loop bug<commit_after>(function(){
  var app = angular.module('trudiedo', []);
  app.filter('escape', function() {
    return window.encodeURIComponent;
  }); 
  app.controller('DosController', function() {
    this.dos = dos;   
    this.theNewDo = {};
    this.tagArray = [];
    for (var i=0;i< dos.length; i++){
      this.tagArray.push(""); 
    }

    this.newDo = function(theNewDo){
      theNewDo.date = Date.now();
      theNewDo.tags = [];
      this.dos.push(theNewDo);
      this.theNewDo = {};
      this.tagArray.push("");
    };

    this.addTag = function(index, newTag) {
      // check for duplicate tags as we don't allow this. 
      console.log(index);
      console.log(this.dos[index].tags.length);
      for (var i=0; i < this.dos[index].tags.length; i++){
        console.log("checking");
        if(newTag === this.dos[index].tags[i]){
          this.tagArray[index] = "";
          return; 
        } 
      }
{'fraction_non_alphanumeric': 0.17620396600566574, 'fraction_numerical': 0.0022662889518413596, 'mean_word_length': 2.3831417624521074, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1421847', 'n_tokens_mistral': 607, 'n_tokens_neox': 583, 'n_words': 105}