Step 70 asks:
“Finally, in your checkUserInput()
function, set the textContent
property of result
equal to the string returned by your decimalToBinary()
function.”
I did this by coding:
result.textContent = decimalToBinary();
And I was able to pass the step. However, when I tried using the converter in Preview Window, “NaN” is always returned as the output.
When I moved on to Step 71, my answer from step 70 was automatically changed to:
result.textContent = decimalToBinary(parseInt(numberInput.value));
And then the converter in the preview worked just fine. I just wanted to point this out because I felt that it was a bit misleading, and if I didn’t pick up on this, I may have been confused as to why a similar approach might not work on a different project in the future, if that makes sense.
I’ve noticed a few similar occurrences in previous lessons too, but thought it might have just been my mistakes. Should I be bringing attention to things like this?
Appreciate what you guys do!