Todo App

Instructions

  • Fork and clone this repo.
  • Complete the following within the index.js file.

Steps

  • Create an empty array called currentTodos

  • Create an empty array called doneTodos

  • Create a function the will show the following on the console:

    Current todos:
    ["Get Dry cleaning", "Review functions", "Review arrays"]
    
    Done todos:
    ["Finish all coded tasks", "Sent important email"]
  • Create a function called completedTodo which will recieve a parameter called todo as a string. Remove the first todo that matches from the current currentTodos list and add it to the doneTodos list.

  • Create a function called validateTodo which will recieve a parameter called todo and return true if the length of the todo was greater than 2, or return false.

  • Create a function called addNewTodo which will recieve a parameter called todo and add it to the currentTodos if the todo element was validated through validateTodo function.

  • Create a function called uncheckTodo which will recieve a parameter called undo which is an index of a todo in the doneTodos array. Remove the todo on the given index and push it to the currentTodos.

  • Create a function called editTodo which will recieve three parameters, index, todoList and updatedTodo and update the correct todo with the new value of updatedTodo.