Even if the tasks array is empty, tasks.length gives us the number of elements in it.