HTML Diff
0 added 0 removed
Original 2026-01-01
Modified 2026-03-09
1 <p>The completed goals have been removed from the to-do list! Let’s proceed to the next item in our job specification:</p>
1 <p>The completed goals have been removed from the to-do list! Let’s proceed to the next item in our job specification:</p>
2 <ul><li>A task is considered completed and disappears if the user clicks the checkbox.</li>
2 <ul><li>A task is considered completed and disappears if the user clicks the checkbox.</li>
3 <li>If all of the tasks are completed, then a message should be displayed informing the user that there are no more tasks.</li>
3 <li>If all of the tasks are completed, then a message should be displayed informing the user that there are no more tasks.</li>
4 <li>If a new task is added to an empty list, the message disappears.</li>
4 <li>If a new task is added to an empty list, the message disappears.</li>
5 <li>To add a new task, you must enter a description in the input field and press “Add task”. The task will then appear at the end of the list.</li>
5 <li>To add a new task, you must enter a description in the input field and press “Add task”. The task will then appear at the end of the list.</li>
6 </ul><p>All of the tasks will be completed when all of the elements are deleted from the list list. Now all of the tasks are located in the items collection, and its length is equal to the number of li elements in the list. If the tasks are deleted, then the collection length will be equal to 0. And then you can show the message.</p>
6 </ul><p>All of the tasks will be completed when all of the elements are deleted from the list list. Now all of the tasks are located in the items collection, and its length is equal to the number of li elements in the list. If the tasks are deleted, then the collection length will be equal to 0. And then you can show the message.</p>
7 <p>For the moment, we do not need to find a message that there are no tasks in the markup and to try to show it. First, let’s make sure that the collection length is actually decreasing. In order to do this, create a function that will check the length (by the way, we have already added the function declaration to the code for you). We will call this function every time after we remove a task.</p>
7 <p>For the moment, we do not need to find a message that there are no tasks in the markup and to try to show it. First, let’s make sure that the collection length is actually decreasing. In order to do this, create a function that will check the length (by the way, we have already added the function declaration to the code for you). We will call this function every time after we remove a task.</p>
8 <p>In this assignment, we will use<b>strict equality</b>to avoid unpredictable results. A strict equality is written as: === (three equal signs). If you have forgotten what this type of equality signifies and why it is used, look at <a>this assignment</a>, where we discussed it.</p>
8 <p>In this assignment, we will use<b>strict equality</b>to avoid unpredictable results. A strict equality is written as: === (three equal signs). If you have forgotten what this type of equality signifies and why it is used, look at <a>this assignment</a>, where we discussed it.</p>