In the saveTasks() function, the code currently uses:
localStorage.setItem("taskList", JSON.stringify(task));
However, task is undefined. The correct variable is tasks, which contains the array of task objects.
This causes tasks not to be saved in localStorage and breaks persistence.
FIX: localStorage.setItem("taskList", JSON.stringify(tasks));
