Learn localStorage by Building a Todo App - Step 48

Tell us what’s happening:

So this lesson has a problem, it tells you that " Your localStorage.setItem() should have a key of **myTaskArr** ." While giving you this example: "
localStorage.setItem(“key”, value); // value could be string, number, or any other data type".

To my understanding as someone learning is that myTaskArr should be in the “key” position. But that’s wrong, “myTaskArr” should be the “value” not the “key”, the “key” is “data” and the “value” is “myTaskArr”.

Your code so far

localStorage.setItem(“data”, myTaskArr)

Your browser information:

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

Challenge Information:

Learn localStorage by Building a Todo App - Step 48

“A myTaskArr array has been provided for you. Use the setItem() method to save it with a key of data.”

This sentence specifically states “with a key of data”. To me that seems like it is telling you exactly what the key should be. But if you don’t think this is clear then can you give a suggestion of what would make it clearer?

That’s what it says in the task, but in the “hint” where it tells you what you should’ve have coded it tells you that you should have “data” as key, when you code that and it doesn’t work it tells you you should have “myTaskArr” as key, but that’s wrong it should tell you “myTaskArr” as “value”.

Ahh, I understand now. I just looked at the source file and you are correct, it mistakenly gives you a hint of “Your localStorage.setItem() should have a key of myTaskArr.” instead of “Your localStorage.setItem() should have a value of myTaskArr.” when you enter the wrong value.

Do you feel comfortable opening a github issue on this?

1 Like

I mean I can open it, but I just learning how to code I probably won’t be of much help over there, yet

To open an issue, all you need to do is be able to describe the problem. You don’t have to suggest a solution if you don’t know what it is, and you certainly don’t have to fix the actual code (that is done in a Pull Request).

For this issue you know both the problem and the solution. The problem is that the step is giving a bad hint when you put the wrong value for the second argument to setItem. And you know what that bad hint is so you can paste it into the issue. You also know the solution is to change the word in that bad hint from “key” to “value”, which will make it a good hint. With this information you can open the issue.

Also, use this link to open the issue. It will take you directly to the exact issue template to use.

1 Like

Actually you will be one of the best people to help report issues. :slight_smile:

As a beginner you have a fresh perspective that the staff doesn’t since you are going through these concepts for the first time.

If a concept is poorly worded or confusing to you as a beginner, then chances are it will be an issue for other beginners going through the curriculum.

Completely agree.

Also, if you are not entirely sure how to describe the issue, just do the best you can.

We have people like myself and @bbsmooth to respond to open issues and flesh it out and clarify what needs to be fixed before it is opened up for contribution. :+1:

2 Likes

Aight, I opened the issue on github: Issue with Learn local storage by building a todo app, lesson 48 · Issue #53167 · freeCodeCamp/freeCodeCamp (github.com)

thanks for all the replies!

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.