Skip to content

Fix wrong variable reference in saveTasks() when saving to localStorage #3

@RehanMehtaIND

Description

@RehanMehtaIND

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));

Image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions