Learn localStorage by Building a Todo App - Step 19

Tell us what’s happening:

What is wrong with this solution? Not really sure why this is not the right answer

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

taskObj.title = titleInput.value;
taskObj.date = dateInput.value;
taskObj.description = descriptionInput.value;

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36

Challenge Information:

Learn localStorage by Building a Todo App - Step 19

In this task the editable codepart is already within the object therefore you need to use object initialization notation such as

Blockquote
title: titleInput.value,
date: dateInput.value

also the object is const so you shouldn’t change it’s values afterwards.

1 Like

So the answer should look like this?:

title = titleInput.value,
date = dateInput.value,
description = descriptionInput.value,

Hi!

Within an object, properties and it’s values aren’t separated by = equal sign. Equal is a assignment operator.

what are they separated by

Have you didn’t learned that in the previous curriculum challenge’s.?

The different punctuations could get confusing

confusion can be resolved with guidance. But you haven’t remember an object Syntex.

Here’s a link to the JavaScript object explanation:

Then this is supposed to work…

title : titleInput.value,
date : dateInput.value,
description : descriptionInput.value,

Now that’s correct. Just remove space before all three colons.

and after the property too it seems…
Is this the usual for all object properties?

The title, date and description are properties for the object. It’s best practices to not have a space between the property and colon.

Before the property value , that’s best practices to have a space like above.