<commit_before>(function(){

  function taskAdded(task){
    
  }

  // this is the ViewModel
  function ToDoViewModel(){
    // do stuff in here:
    // var self = this;
    // this.tasks = [ ]
    // this.addTask = function(){};
    // this.removeTask = function(){};
    // this.completeTask = function(){};
  };

})();<commit_msg>initial js scaffolding completed<commit_after>(function(){

  // constructor for inputting a new task
  function taskAdded(task){
    this.task = task;
    this.completed = false;
  };

  // this is the ViewModel
  function ToDoViewModel(){
    var self = this;
    this.tasks = [
      new taskAdded('Drink the beers'),
      new taskAdded('Read the books')
    ];
    this.addTask = function(task){
      self.tasks.push(new taskAdded(task));
    };
    // research this .remove() method, is this from knockout and reads the index #?
    this.removeTask = function(task){
      self.tasks.remove(task);
    };
    // FIXME: This probably isn't right, research how to feed it the approp. index
    this.completeTask = function(index){
      self.tasks[index].completed = true;
    };
  };

  // apply bindings to the browser
  ko.applyBindings(new ToDoViewModel());

})();
{'fraction_non_alphanumeric': 0.14250207125103562, 'fraction_numerical': 0.0, 'mean_word_length': 2.7169230769230768, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2170166', 'n_tokens_mistral': 370, 'n_tokens_neox': 355, 'n_words': 100}