fix(curriculum): decimal to binary converter step 77 wording change (#55644)

This commit is contained in:
Gagan Bhullar
2024-07-25 11:39:12 -06:00
committed by GitHub
parent 02b1077abe
commit 788c621ea0
@@ -7,9 +7,11 @@ dashedName: step-77
# --description--
Now your `showAnimation()` function is set up. But if you look closely at your `checkUserInput()` function, you'll notice that it's not very DRY you're calling `parseInt()` to convert `numberInput.value` into a number several times.
Now your `showAnimation()` function is set up. But if you look at your `checkUserInput()` function, you'll notice that it is calling `parseInt()` to convert `numberInput.value` into a number several times.
A simple way to fix this is to create a new variable to store the converted number. Then you only have to convert the number once and can use it throughout the function.
This is generally a poor practice, for reasons like performance concerns or even just the fact that you'd have to change your logic in multiple places to update the `parseInt()` call.
To fix this, create a new variable to store the converted number. Then you only have to convert the number once and can use it throughout the function.
Create a new variable called `inputInt` and assign it the number converted from `numberInput.value`.