mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(curriculum): decimal to binary converter step 77 wording change (#55644)
This commit is contained in:
+4
-2
@@ -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`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user