Quise correr el ejercicio en el aula de Leo/Chris y me marca un error: Uncaught ReferenceError: Cannot access 'numeroSecreto' before initialization at generarNumeroSecreto (app.js:23:26) at app.js:2:21
¿Alguien Puede Ayudarme Por favor?
Este es el código:
let numeroSecreto = generarNumeroSecreto();
console.log(numeroSecreto);
function asignarTextoElemento(elemento, texto) {
let elementoHTML = document.querySelector(elemento);
elementoHTML.innerHTML = texto;
return;
}
function intentoDeUsuario() {
alert('Click desde el Botón');
return;
}
function generarNumeroSecreto() {
return numeroSecreto = Math.floor(Math.random() * 10) + 1;
}
asignarTextoElemento('h1', '¡Juego de Adivinar Números!'); asignarTextoElemento('p', 'Pon un número entre el 1 y 100');