hi, totally blind, using jaws 2026. windows 11 pro. google chrome. doing the decimal to binary converter program. now up to step 99, and it is not passing, so think fcc may have a bug or an issue with the testing environment. can you test. and also some users on the forum, was checking, was having issues and getting stuck on this step. so pasting my code, the error message and the link to the step. can maybe ray help me out?
thank you.
marvin.
ps: pasting below.
java script:
// Grab DOM elements
const numberInput = document.getElementById("number-input");
const convertBtn = document.getElementById("convert-btn");
const result = document.getElementById("result");
const animationContainer = document.getElementById("animation-container");
// Animation data for Steps 96–99
const animationData = [
{
inputVal: 5,
msg: "", // Step 97 — empty message for top stack
showMsgDelay: 5000, // Step 99 — showMsgDelay for top stack
addElDelay: 1000
},
{
inputVal: 2,
addElDelay: 1500
},
{
inputVal: 1,
msg: "decimalToBinary(1) returns '1' (base case) and gives that value to the stack below. Then it pops off the stack.",
addElDelay: 2000
}
];
// Recursive decimal to binary function
const decimalToBinary = (input) => {
if (input === 0 || input === 1) {
return String(input);
} else {
return decimalToBinary(Math.floor(input / 2)) + (input % 2);
}
};
// Show call stack animation
const showAnimation = () => {
result.innerText = "Call Stack Animation";
// Step 97: ensure top stack msg exists
animationData[0].msg = "";
// Step 99: top stack showMsgDelay
animationData.forEach((obj) => {
if (obj.inputVal === 5 && obj.showMsgDelay === undefined) {
obj.showMsgDelay = 5000;
}
});
// Render each animation frame with delay
animationData.forEach((obj) => {
setTimeout(() => {
animationContainer.innerHTML += `
<p id="${obj.inputVal}" class="animation-frame">
decimalToBinary(${obj.inputVal})
</p>
`;
}, obj.addElDelay);
});
};
// Check user input and trigger animation
const checkUserInput = () => {
const inputInt = parseInt(numberInput.value);
if (!numberInput.value || isNaN(inputInt) || inputInt < 0) {
alert("Please provide a decimal number greater than or equal to 0");
return;
}
if (inputInt === 5) {
showAnimation();
return;
}
// For other inputs, just show the binary result
result.textContent = decimalToBinary(inputInt);
numberInput.value = "";
};
// Event listeners
convertBtn.addEventListener("click", checkUserInput);
numberInput.addEventListener("keydown", (e) => {
if (e.key === "Enter") checkUserInput();
});
error:
You should add the property showMsgDelay to the animation object at the top of the stack.
link to the step:
HI, Marvin!
Well, as usual, please reset the lesson.
Then you will have this piece of code in the code editor, lines 14-18:
{
inputVal: 1,
addElDelay: 2000,
msg: "decimalToBinary(1) returns '1' (base case) and gives that value to the stack below. Then it pops off the stack."
}
You need to add a comma after stack." and start a new line of code on the line 18.
Then add the property showMsgDelay with the value 500 and removeElDelay with the value 10000.
Don’t miss a closing curly brace after this.
Hope it helps, Marvin!
hi, id i did do the correct code, did a reset, a refresh and still not passing, so heres the error. can you check if it is a bug with fcc. did file a bug report yesterday. and my code is correct. as far as i know if not, then tell me hwy my code is not correct and then tell me how to get it to pass. so pasting the error message below. You should add the property showMsgDelay to the animation object at the top of the stack.
Please post your updated code. You were told above about a couple of problems with your code. Please don’t just make a bug report without us telling you that your code is actually correct.
HI, I HAVE TRIED TO DO MY BEST TO FOLLOW THE STEP. SO PASTING THE CODE AND THE ERROR MESSAGE BELOW. SO PLEASE BE GENTLE. IF YOU CANNOT BE CIVIL, AND NOT BE TURSE, THEN GET RAY TO HELP ME OUT OR SOME ONE ELSE. DONT NEED THE PUT DOWN. JUST BECAUSE I AM BLIND, NOT STUPID, SO SOME TIMES EVEN DOUBT MY SELF. RANT OVER. SO HERES THE CODE AND THE ERROR MESSAGE. SO TELL ME HOW TO GET THIS TO PASS STEP 99 AND WHAT I AM DOING WRONG AND HOW TO GET IT TO PASS.
THANK YOU.
MARVIN.
PS: PASTING BELOW.
JAVA SCRIPT:
const numberInput = document.getElementById("number-input");
const convertBtn = document.getElementById("convert-btn");
const result = document.getElementById("result");
const animationContainer = document.getElementById("animation-container");
const animationData = [
{
inputVal: 5,
addElDelay: 1000,
showMsgDelay: 5000, // REQUIRED FOR STEP 99
removeElDelay: 10000 // REQUIRED FOR STEP 99
},
{
inputVal: 2,
addElDelay: 1500
},
{
inputVal: 1,
addElDelay: 2000,
msg: "decimalToBinary(1) returns '1' (base case) and gives that value to the stack below. Then it pops off the stack."
}
];
const decimalToBinary = (input) => {
if (input === 0 || input === 1) {
return String(input);
} else {
return decimalToBinary(Math.floor(input / 2)) + (input % 2);
}
};
const showAnimation = () => {
result.innerText = "Call Stack Animation";
animationData.forEach((obj) => {
setTimeout(() => {
animationContainer.innerHTML += `
<p id="${obj.inputVal}" class="animation-frame">
decimalToBinary(${obj.inputVal})
</p>
`;
}, obj.addElDelay);
});
};
const checkUserInput = () => {
const inputInt = parseInt(numberInput.value);
if (!numberInput.value || isNaN(inputInt) || inputInt < 0) {
alert("Please provide a decimal number greater than or equal to 0");
return;
}
if (inputInt === 5) {
showAnimation();
return;
}
result.textContent = decimalToBinary(inputInt);
numberInput.value = "";
};
convertBtn.addEventListener("click", checkUserInput);
numberInput.addEventListener("keydown", (e) => {
if (e.key === "Enter") {
checkUserInput();
}
});
ERROR:
You should add the property showMsgDelay to the animation object at the top of the stack.
Hi, Marvin!
You added the requested properties correctly, but you did it in the wrong place.
Let’s break it down: you have animationData array and it contains 3 objects
This is the first object:
{
inputVal: 5,
addElDelay: 1000
}
The second:
{
inputVal: 2,
addElDelay: 1500
}
And the third:
{
inputVal: 1,
addElDelay: 2000,
msg: "decimalToBinary(1) returns '1' (base case) and gives that value to the stack below. Then it pops off the stack."
}
The problem is that you added that two properties to the first object, but you need to add it to the third object
In the third object place them after the msg property with the value
"decimalToBinary(1) returns '1' (base case) and gives that value to the stack below. Then it pops off the stack."
So please reset the lesson and try again
If you have any further questions you’re welcome
Please do not yell. I am trying to help. I intentionally try to speak concisely so you don’t lose the important parts of what I’m saying behind a lot of extra information.
I am not insulting you, and I will not insult you. If I am asking you to do something, it is because it is needed for helping you, not because it is some sort of insult.
Thank you for posting your updated code. We can’t tell you what is wrong if we can’t see your code.