Open igarrido-adalab opened 10 months ago
Gracias por los comentarios. ¿A qué te refieres con este issue 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. textTry or attemps)? Mil gracias
Creo que ya lo hablamos en persona, pero lo dejo aquí por escrito: Me refiero a que los nombres de las variables no sean susceptibles de confundir lo que contienen. Por ejemplo, la variable attempts
parece que puede almacenar el número de intentos pero en realidad tiene el elemento del HTML de la página que muestra a la usuaria los intentos. Un nombre mejor sería attemptsParagraph
Really cool job @INDRAKL !!!
Here you have some tips to improve the exercise:
JavaScript: basic
getRandomNumber
function inside the event callback, you will be creating a new random number every time the user clicks the button. That makes the game really difficult to play and the hints will have different results. Let's generate the random number when the page loads and starts the game.event
method outside the handler function https://github.com/Adalab/modulo-2-evaluacion-intermedia-INDRAKL/blob/eb8639301e70d4274aa2c3b5445d57230bd1b04d/js/main.js#L18event.preventDefault()
you must declare theevent
parameter in the funcion.textTry
orattemps
)JavaScript: advanced
updateScore
https://github.com/Adalab/modulo-2-evaluacion-intermedia-INDRAKL/blob/eb8639301e70d4274aa2c3b5445d57230bd1b04d/js/main.js#L25."clueEl.innerHTML = 'something';"
, what about making a function that accepts a string as param and paints it into'clueEl'
?Good practices
Structure
./
.Further challenges
Then you can improve the game as you please, here you have some ideas:
setTimeout
).Call to action
Let me know if you have any doubts ;)
Go for it!!