hi, okay did post a new topic, but it got either lost, fcc or the forum had a fit, said it then saved and continue but, i cannot find it it was called build a decimal to binary converter step 66 but i cannot find it, did try on firefox and edge, and then had to reset my password. so i am sorry about this, so was safer just to do a reply, then to earn the wrath of the lead manager and get suspended again. so, hope this is okay. so my issue, is doing build a decimal to binary converter and up to step 66. and supposed to do a blank straight function which i have done, but it is not passing, says to have an empty body which i am. so is fcc got a bug, is my code or logic not correct? or something else, hidden characters, stray characters which my screen reader cannot read, hidden trailing spaces. so can any one help.
going to paste the code, the error and the step.
thank you.
marvin.
ps: pasting my java script code.
const numberInput = document.getElementById("number-input");
const convertBtn = document.getElementById("convert-btn");
const result = document.getElementById("result");
// decimalToBinary as a regular function (Step 66)
function decimalToBinary() {
}
const checkUserInput = () => {
if (!numberInput.value || isNaN(parseInt(numberInput.value)) || parseInt(numberInput.value) < 0) {
alert("Please provide a decimal number greater than or equal to 0");
return;
}
decimalToBinary(parseInt(numberInput.value));
numberInput.value = "";
};
convertBtn.addEventListener("click", checkUserInput);
numberInput.addEventListener("keydown", (e) => {
if (e.key === "Enter") {
checkUserInput();
}
});
error:
The body of your decimalToBinary() function should be empty.
it looks like the decimalToBinary function is an arrow function at the start of this step, changing the function to a different format could cause the step to not pass
Hi, Marvin!
As usual, first of all please reset the step.
In the starting code you need to remove all the code from the line 6 to 17.
You did it right.
On the line 5 left this untouched:
const decimalToBinary = (input) => {
And the closing curly brace, make sure not to remove it too.
Hope this helps!
hi, something not right. doing step 66 of the build a decimal to binary converter. i have written up the function correctly, but wondering if i have empty spaces, or hidden characters, which my screen reader cann not show me, and so i didd reset the lesson, refresh the page, rewrote the function, cleared cache for 24 hours, and then tried on firefox and edge, but it is not passing, and i dont know why. is it my code, or something tripping up in fcc? can you help me out ray. frustrated and dont know why, maybe hidden spacing, which my screen readers jaws, nvda and windows narrator on windows 11. cannot see or i cannot hear, have tried ocr function and object navigation, but nothing. so, can you help me? not passing, and tried for the past 2 to 3 hours to troubleshoot. but it is not passing, frustrated. and only one blind developer student. so what am i doing wrong? can you help me out? and in adelaide, australia. so will paste the javascript code, the error below.
frustrated.
thank you.
marvin.
ps: pasting below.
java script:
const decimalInput = document.getElementById('decimal-input');
const convertButton = document.getElementById('convert-btn');
const resetButton = document.getElementById('reset-btn');
const binaryOutput = document.getElementById('binary-output');
function decimalToBinary() {
}
function handleConvert() {
const decimalValue = parseInt(decimalInput.value);
if (isNaN(decimalValue) || decimalValue < 0) {
binaryOutput.textContent = 'Please enter a non-negative integer';
return;
}
// Do NOT call decimalToBinary yet.
// Do NOT reference binaryResult.
binaryOutput.textContent = '';
}
function handleReset() {
decimalInput.value = '';
binaryOutput.textContent = '';
}
convertButton.addEventListener('click', handleConvert);
decimalInput.addEventListener('keypress', function(event) {
if (event.key === 'Enter') {
handleConvert();
}
});
resetButton.addEventListener('click', handleReset);
error:
The body of your decimalToBinary() function should be empty.: