Coding Log — January 5th, 2018 — Day 20

Coding Time: Full Day

Here’s what I did today:

Continued Watch & Code

Made good progress today, but couldn’t finish. I’m 75% of the way through. I’ll finish in the first few hours of the day and hopefully have enough time to start something new!

Here’s the code thus far:

var todoList = {
  todos: [],
  displayTodos: function() {
    if (this.todos.length === 0) {
      console.log('You have nothing left to do today. :)');
    } else {
      console.log("My todos:");
      for (var i = 0; i < this.todos.length; i++) {
        if (this.todos[i].completed === true) {
          console.log('(x)', this.todos[i].todoText);
        } else {
          console.log('( )', this.todos[i].todoText);
        }
      }
    }
  },
  addTodo: function(todoText) {
    this.todos.push({
      todoText: todoText,
      completed: false
    });
    this.displayTodos();
  },
  changeTodo: function(position, todoText) {
    this.todos[position].todoText = todoText;
    this.displayTodos();
  },
  deleteTodo: function(deleteTodo) {
    this.todos.splice(deleteTodo, 1);
    this.displayTodos();
  },
  toggleCompleted: function(position) {
    var todo = this.todos[position];
    todo.completed = !todo.completed;
    this.displayTodos();
  },
  toggleAll: function() {
    var totalTodos = this.todos.length;
    var completedTodos = 0;
    for (var i = 0; i < totalTodos; i++) {
      if (this.todos[i].completed === true) {
        completedTodos++;
      }
    }
    if (completedTodos === totalTodos) {
      for (var i = 0; i < totalTodos; i++) {
        this.todos[i].completed = false;
      }
    } else {
      for (var i = 0; i < totalTodos; i++) {
        this.todos[i].completed = true;
      }
    }
    this.displayTodos();
  }
};

var handlers = {
  displayTodos: function() {
    todoList.displayTodos();
  },
  toggleAll: function() {
    todoList.toggleAll();
  },
  addTodo: function() {
    var addTodoTextInput = document.getElementById('addTodoTextInput')
    todoList.addTodo(addTodoTextInput.value);
    addTodoTextInput.value = '';
  }
};

Increasingly complicated. We moved into DOM/working with the browser today, which I’ve been looking forward to for a while. Now that I know this, I can do anything.

Bought The Web Developer Bootcamp

$10.99 is probably the cheapest it’s ever going to get. Apparently, it’s already had new content added this month. As of right now, the only Udemy courses I’m going to be taking are this and JavaScript: The Weird Parts. I’m skeptical about the follow-up to this course – I think I’ll move on to Wes Bos then. The Flexbox course was really good, even though the Markdown course put me to sleep.

Regardless, there’s 44 hours of videos here and a total of 347 items to complete. I hope to start this tomorrow and get through it relatively quickly.

As long as I focus and take frequent breaks, I don’t doubt I’ll be able to finish this within a few weeks.

Tomorrow’s To-Do’s

Finish Watch & Code! It’s coming along nicely. The to-do list probably won’t be a good side project to upload just yet, it will definitely need some customization. But it’s nice to know that I have a template to work from to eventually be hosted and shown off at todo.rmorabia.com.

Start the Web Developer Bootcamp! I’ve been thinking about this one for a long time, so I hope it lives up to the hype.

Comments can be sent via email.

Subscribe via RSS Feed.