[x] Watch out for constant names used to save DOM references... Do we want to use the DOM reference or that DOM element content (innerHTML/value)? (I.E. number, tip or attempts)
JavaScript: advanced
[x] You are writing many times "trackEl.innerHTML = 'something';", what about making a function that accepts a string as param and paints it into 'trackEl'?
Good practices
[x] Try to use imperative for functions names.
Further challenges
Then you can improve the game as you please, here you have some ideas:
Add new feedback when the number is bigger than 100 or smaller than 0.
Manage when the user hits the button and the input is empty.
Make the input work when hitting enter key.
Add a reset button that cleans the input, the counter, writes the initial feedback and generates a new random number to play again!
Whatever you want!
Call to action
Let me know if you have any doubts ;)
Go for it!!
Do not close this issue until your teacher asks you to
Really cool job @LitaGarcia !!!
Here you have some tips to improve the exercise:
JavaScript: basic
button
is declared but is never used.generatorNumber(100)
is not used by the function (because it hasn't got a parameter). https://github.com/Adalab/modulo-2-evaluacion-intermedia-LitaGarcia/blob/dbdfd947dc40511d3c2e332c752a02d3383cabe0/js/main.js#L21number
,tip
orattempts
)JavaScript: advanced
"trackEl.innerHTML = 'something';"
, what about making a function that accepts a string as param and paints it into'trackEl'
?Good practices
Further challenges
Then you can improve the game as you please, here you have some ideas:
Call to action
Let me know if you have any doubts ;)
Go for it!!