Abycode
September 23, 2024, 11:12am
1
Tell us what’s happening:
I have been back and forth with this step exercise; I think all requested tasks has been implemented yet couldn’t pass the code.
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
function updateScore(selectedValue, achieved) {
score += parseInt(selectedValue);
totalScore.textContent = score;
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/128.0.0.0 Safari/537.36 Edg/128.0.0.0
Challenge Information:
Review Algorithmic Thinking by Building a Dice Game - Step 9
hbar1st
September 23, 2024, 11:33am
2
The formatting of the string is off. As I recall the colon had a space to the left and right of it. Try that.
Abycode
September 23, 2024, 11:39am
3
updated code:
function updateScore(selectedValue, achieved) {
score += parseInt(selectedValue);
totalScore.textContent = score;
scoreHistory.innerHTML += `<li>${achieved} : ${selectedValue}</li>`;
};
Yet. can’t pass…
im59138
September 23, 2024, 11:59am
4
double check this, what’s the variable with the element?
1 Like
hbar1st
September 23, 2024, 11:59am
5
Can you make it an arrow function instead?
It may be expecting the same style as all the other functions.
Abycode
September 23, 2024, 1:01pm
6
updated code
const updateScore = (selectedValue, achieved) => {
score += parseInt(selectedValue);
totalScore.textContent = score;
scoreHistory.innerHTML += `<li>${achieved} : ${selectedValue}</li>`;
};
yet!
hbar1st
September 23, 2024, 1:08pm
7
As Ilenia mentioned the variable totalScore should be fixed as that is not the correct name of it.
1 Like
Abycode
September 23, 2024, 1:11pm
8
It absolute was the issue, it variable does have an extension of Element. thank you so much for feedback, appreciated. !
Abycode
September 23, 2024, 1:12pm
9
Thank you for your feedback
Abycode
September 23, 2024, 1:14pm
10
I would like to ask though, sometimes the excise is quiet out of the purview of understanding, what its fact means is to seek out others methods or solutions at such to have a clue?
hbar1st
September 23, 2024, 2:00pm
11
if you think something is being asked of you that is completely new, let us know, but also definitely try to use google to help you look up answers (and of course search the forum). It is normal to need to look things up when learning.
1 Like