I don’t understand the errors i’m getting:
Your updateScore function should add the value of the first parameter to the total score.
Your updateScore function should update the text of the totalScore element.
Your updateScore function should add a new list item to the scoreHistory element.
When updateScore(10, “hi”) is called, your new list element should have the text hi: 10.
I believe i have done what the Step is asking
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
const updateScore = (selectedValue, achieved) => {
totalScore += parseInt(selectedValue);
totalScoreText.textContent = totalScore;
scoreHistory.innerHTML += `<li>${achieved} : ${selectedValue}</li>`;
};
// 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/126.0.0.0 Safari/537.36
Challenge Information:
Review Algorithmic Thinking by Building a Dice Game - Step 9
Because FreeCodeCamp seems to have condensed this project into 18 steps (from over 60) - i’m finding the instructions too brief to understand. So i’ve been following a You Tube video which has the 60+ steps. But unfortunately, that seems to use slightly different variable names.
but still getting these errors:
Your updateScore function should add the value of the first parameter to the total score.
Your updateScore function should update the text of the totalScore element.
When updateScore(10, “hi”) is called, your new list element should have the text hi: 10.
i don’t “copy” Youtube - i pause the video to read old (longer, more detailed) step, complete the step myself, then unpause the video to confirm i have done it correctly.
As i stated above, this lesson has been changed from 60+ steps, into 18 steps. And it’s impossible to complete the project by only reading the 18 steps, they are too brief and don’t give anywhere near enough information. Even when i’ve asked for help on the forums, the people responding don’t seem know what to do either. So there is definitely something wrong with this lesson.
I’d put a complaint/feedback in, but as it says JavaScript Algorithms and Data Structures is “currently in beta”, i assume that they are still working on this lesson and are in the processes of fixing the issues i’m talking about.
The point of this project is for you to try to develop the logic instead of being lead through it step by step. A walkthrough video defeats the purpose. A downside of too many steps in the project based approach is that you never have to stop and think up approaches to solve anything so these more open ended projects were added so you have a middle ground before the certification projects.
you either can’t understand what i wrote or you just aren’t reading it properly.
i’m not being “led” through anything. The video merely gives me access to the longer steps. Like i said, i pause the video before the person in video does anything, so i’m not copying what they do. I’m doing it myself.
This is 21st lesson in JavaScript Algorithms and Data Structures - the other 20 i have completed. By making this lesson only 18 steps, i believe they have made it too hard. And i don’t believe anyone at the same level as me would be able to complete it.
No other variable defined with name ‘totalScore’, but still getting errors as:
Your updateScore function should add the value of the first parameter to the total score.
Your updateScore function should update the text of the totalScore element.
If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Ask for Help button located on the challenge (it looks like a question mark). This button only appears if you have tried to submit an answer at least three times.
The Ask for Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.
It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.
We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.
Yup, I think the fact that they condensed several steps and erased explanation of what was requested ended up in confusing new steps. Try iterating within the let variables, maybe total is not what is needed.