Tell us what’s happening:
i cant understand how to fllow this step, can anyone explain it like you would to a 10 year old ^^
Your code so far
<!-- file: index.html -->
/* file: script.js */
// User Editable Region
const addOrUpdateTask = () => {
const dataArrIndex = taskData.findIndex(task => task.id === currentTask.id);
const taskObj = {
id: currentTask.id || `${titleInput.value.toLowerCase().split(" ").join("-")}-${Date.now()}`,
title: titleInput.value.trim(),
date: dateInput.value,
description: descriptionInput.value.trim()
};
if (dataArrIndex === -1) {
taskData.unshift(taskObj);
} else {
taskData[dataArrIndex] = taskObj;
}
};
// User Editable Region
/* file: styles.css */
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Challenge Information:
Learn localStorage by Building a Todo App - Step 36